Skip to content

Commit 5b3c43b

Browse files
#370 Change IllegalArgumentException to ZipException
1 parent dc00748 commit 5b3c43b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/net/lingala/zip4j/model/enums/AesVersion.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
package net.lingala.zip4j.model.enums;
22

3+
import net.lingala.zip4j.exception.ZipException;
4+
35
/**
46
* Indicates the AES format used
57
*/
68
public enum AesVersion {
79

810
/**
9-
* Version 1 of the AES format
11+
* Version 1 of the AES format
1012
*/
1113
ONE(1),
1214
/**
13-
* Version 2 of the AES format
15+
* Version 2 of the AES format
1416
*/
1517
TWO(2);
1618

@@ -32,13 +34,13 @@ public int getVersionNumber() {
3234
* @return the AESVersion instance for a given version
3335
* @throws IllegalArgumentException if an unsupported version is given
3436
*/
35-
public static AesVersion getFromVersionNumber(int versionNumber) {
37+
public static AesVersion getFromVersionNumber(int versionNumber) throws ZipException {
3638
for (AesVersion aesVersion : values()) {
3739
if (aesVersion.versionNumber == versionNumber) {
3840
return aesVersion;
3941
}
4042
}
4143

42-
throw new IllegalArgumentException("Unsupported Aes version");
44+
throw new ZipException("Unsupported Aes version");
4345
}
4446
}

0 commit comments

Comments
 (0)