src/share/classes/org/openjdk/jigsaw/Repository.java

Print this page

        

*** 40,50 **** { /** * <p> The type of a module file <p> */ ! public static enum ModuleType { // ## Should be ModuleFileType /** * A module type that is a java module file */ JMOD("jmod"), --- 40,50 ---- { /** * <p> The type of a module file <p> */ ! public static enum ModuleFileType { /** * A module type that is a java module file */ JMOD("jmod"),
*** 53,63 **** */ JAR("jar"); private final String extension; ! ModuleType(String suffix) { this.extension = suffix; } public String getFileNameExtension() { return extension; --- 53,63 ---- */ JAR("jar"); private final String extension; ! ModuleFileType(String suffix) { this.extension = suffix; } public String getFileNameExtension() { return extension;
*** 74,86 **** * @return the module type. * @throws IllegalArgumentException if {@code extension} * has no corresponding module type. * @throws NullPointerException if {@code extension} is null */ ! public static ModuleType fromFileNameExtension(String extension) { Objects.requireNonNull(extension, "Extension is null"); ! for (ModuleType type: values()) { if (type.extension.equals(extension)) { return type; } } --- 74,86 ---- * @return the module type. * @throws IllegalArgumentException if {@code extension} * has no corresponding module type. * @throws NullPointerException if {@code extension} is null */ ! public static ModuleFileType fromFileNameExtension(String extension) { Objects.requireNonNull(extension, "Extension is null"); ! for (ModuleFileType type: values()) { if (type.extension.equals(extension)) { return type; } }
*** 91,111 **** } /** * <p> Size and type information about a yet-to-be-installed module </p> */ ! public static class ModuleMetaData { // ## Should be ModuleFileMetaData ! private final ModuleType type; /** ! * The type of the module. */ ! public ModuleType getType() { return type; } private final long csize; /** * The module's download size, in bytes. */ --- 91,120 ---- } /** * <p> Size and type information about a yet-to-be-installed module </p> */ ! public static class ModuleFileMetaData { ! private final ModuleFileType type; /** ! * The type of the module-file.. */ ! public ModuleFileType getType() { return type; } + private ModuleArchitecture modArch; + + /** + * The Architecture of a module-file + */ + public ModuleArchitecture architecture() { + return modArch; + } + private final long csize; /** * The module's download size, in bytes. */
*** 120,131 **** * than the value returned by this method, but it will never be * greater. </p> */ public long getInstallSize() { return usize; } ! ModuleMetaData(ModuleType t, long cs, long us) { type = t; csize = cs; usize = us; } } --- 129,142 ---- * than the value returned by this method, but it will never be * greater. </p> */ public long getInstallSize() { return usize; } ! ModuleFileMetaData(ModuleFileType t, ModuleArchitecture ma, ! long cs, long us) { type = t; + modArch = ma; csize = cs; usize = us; } }
*** 139,149 **** * requested module * * @throws IllegalArgumentException * If the named module is not present in this repository */ ! public abstract ModuleMetaData fetchMetaData(ModuleId mid) throws IOException; /** * Fetch the bytes for a given module. * * @param mid --- 150,161 ---- * requested module * * @throws IllegalArgumentException * If the named module is not present in this repository */ ! public abstract ModuleFileMetaData fetchMetaData(ModuleId mid) ! throws IOException; /** * Fetch the bytes for a given module. * * @param mid
*** 153,160 **** * @throws IllegalArgumentException * If the named module is not present in this repository * @throws IOException * If there is an error fetching the module. */ ! public abstract InputStream fetch(ModuleId mid) throws IOException; } --- 165,173 ---- * @throws IllegalArgumentException * If the named module is not present in this repository * @throws IOException * If there is an error fetching the module. */ ! public abstract InputStream fetch(ModuleId mid) ! throws IOException; }