61 magic[1] != JMOD_MAGIC_NUMBER[1]) {
62 throw new IOException("Invalid jmod file: " + file.toString());
63 }
64 if (magic[2] > JMOD_MAJOR_VERSION ||
65 (magic[2] == JMOD_MAJOR_VERSION && magic[3] > JMOD_MINOR_VERSION)) {
66 throw new IOException("Unsupported jmod version: " +
67 magic[2] + "." + magic[3] + " in " + file.toString());
68 }
69 }
70 }
71
72 /**
73 * JMOD sections
74 */
75 public static enum Section {
76 CLASSES("classes"),
77 CONFIG("conf"),
78 HEADER_FILES("include"),
79 LEGAL_NOTICES("legal"),
80 MAN_PAGES("man"),
81 NATIVE_LIBS("native"),
82 NATIVE_CMDS("bin");
83
84 private final String jmodDir;
85 private Section(String jmodDir) {
86 this.jmodDir = jmodDir;
87 }
88
89 /**
90 * Returns the directory name in the JMOD file corresponding to
91 * this section
92 */
93 public String jmodDir() { return jmodDir; }
94 }
95
96 /**
97 * JMOD file entry.
98 *
99 * Each entry corresponds to a ZipEntry whose name is:
100 * Section::jmodDir + '/' + name
101 */
|
61 magic[1] != JMOD_MAGIC_NUMBER[1]) {
62 throw new IOException("Invalid jmod file: " + file.toString());
63 }
64 if (magic[2] > JMOD_MAJOR_VERSION ||
65 (magic[2] == JMOD_MAJOR_VERSION && magic[3] > JMOD_MINOR_VERSION)) {
66 throw new IOException("Unsupported jmod version: " +
67 magic[2] + "." + magic[3] + " in " + file.toString());
68 }
69 }
70 }
71
72 /**
73 * JMOD sections
74 */
75 public static enum Section {
76 CLASSES("classes"),
77 CONFIG("conf"),
78 HEADER_FILES("include"),
79 LEGAL_NOTICES("legal"),
80 MAN_PAGES("man"),
81 NATIVE_LIBS("lib"),
82 NATIVE_CMDS("bin");
83
84 private final String jmodDir;
85 private Section(String jmodDir) {
86 this.jmodDir = jmodDir;
87 }
88
89 /**
90 * Returns the directory name in the JMOD file corresponding to
91 * this section
92 */
93 public String jmodDir() { return jmodDir; }
94 }
95
96 /**
97 * JMOD file entry.
98 *
99 * Each entry corresponds to a ZipEntry whose name is:
100 * Section::jmodDir + '/' + name
101 */
|