View | Details | Raw Unified | Return to bug 35897
Collapse All | Expand All

(-)dist/src/java/org/apache/poi/hssf/record/FilePassRecord.java (-2 / +3 lines)
Lines 17-22 Link Here
17
17
18
package org.apache.poi.hssf.record;
18
package org.apache.poi.hssf.record;
19
19
20
import org.apache.poi.EncryptedDocumentException;
20
import org.apache.poi.util.HexDump;
21
import org.apache.poi.util.HexDump;
21
import org.apache.poi.util.LittleEndianOutput;
22
import org.apache.poi.util.LittleEndianOutput;
22
23
Lines 49-55 Link Here
49
50
50
		switch (_encryptionType) {
51
		switch (_encryptionType) {
51
			case ENCRYPTION_XOR:
52
			case ENCRYPTION_XOR:
52
				throw new RecordFormatException("HSSF does not currently support XOR obfuscation");
53
				throw new EncryptedDocumentException("HSSF does not currently support XOR obfuscation");
53
			case ENCRYPTION_OTHER:
54
			case ENCRYPTION_OTHER:
54
				// handled below
55
				// handled below
55
				break;
56
				break;
Lines 63-69 Link Here
63
				break;
64
				break;
64
			case ENCRYPTION_OTHER_CAPI_2:
65
			case ENCRYPTION_OTHER_CAPI_2:
65
			case ENCRYPTION_OTHER_CAPI_3:
66
			case ENCRYPTION_OTHER_CAPI_3:
66
				throw new RecordFormatException(
67
				throw new EncryptedDocumentException(
67
						"HSSF does not currently support CryptoAPI encryption");
68
						"HSSF does not currently support CryptoAPI encryption");
68
			default:
69
			default:
69
				throw new RecordFormatException("Unknown encryption info " + _encryptionInfo);
70
				throw new RecordFormatException("Unknown encryption info " + _encryptionInfo);
(-)dist/src/java/org/apache/poi/hssf/record/RecordFactory.java (+5 lines)
Lines 24-29 Link Here
24
import java.lang.reflect.Modifier;
24
import java.lang.reflect.Modifier;
25
import java.util.*;
25
import java.util.*;
26
26
27
import org.apache.poi.EncryptedDocumentException;
27
import org.apache.poi.hssf.record.chart.*;
28
import org.apache.poi.hssf.record.chart.*;
28
import org.apache.poi.hssf.record.pivottable.*;
29
import org.apache.poi.hssf.record.pivottable.*;
29
30
Lines 62-67 Link Here
62
			} catch (IllegalAccessException e) {
63
			} catch (IllegalAccessException e) {
63
				throw new RuntimeException(e);
64
				throw new RuntimeException(e);
64
			} catch (InvocationTargetException e) {
65
			} catch (InvocationTargetException e) {
66
                // Unwrap "expected" exceptions.
67
                if (e.getTargetException() instanceof EncryptedDocumentException) {
68
                    throw (EncryptedDocumentException) e.getTargetException();
69
                }
65
				throw new RecordFormatException("Unable to construct record instance" , e.getTargetException());
70
				throw new RecordFormatException("Unable to construct record instance" , e.getTargetException());
66
			}
71
			}
67
		}
72
		}

Return to bug 35897