src/share/classes/org/openjdk/jigsaw/Repository.java
Print this page
@@ -40,11 +40,11 @@
{
/**
* <p> The type of a module file <p>
*/
- public static enum ModuleType { // ## Should be ModuleFileType
+ public static enum ModuleFileType {
/**
* A module type that is a java module file
*/
JMOD("jmod"),
@@ -53,11 +53,11 @@
*/
JAR("jar");
private final String extension;
- ModuleType(String suffix) {
+ ModuleFileType(String suffix) {
this.extension = suffix;
}
public String getFileNameExtension() {
return extension;
@@ -74,13 +74,13 @@
* @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) {
+ public static ModuleFileType fromFileNameExtension(String extension) {
Objects.requireNonNull(extension, "Extension is null");
- for (ModuleType type: values()) {
+ for (ModuleFileType type: values()) {
if (type.extension.equals(extension)) {
return type;
}
}
@@ -91,21 +91,30 @@
}
/**
* <p> Size and type information about a yet-to-be-installed module </p>
*/
- public static class ModuleMetaData { // ## Should be ModuleFileMetaData
+ public static class ModuleFileMetaData {
- private final ModuleType type;
+ private final ModuleFileType type;
/**
- * The type of the module.
+ * The type of the module-file..
*/
- public ModuleType getType() {
+ 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,12 +129,14 @@
* 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) {
+ ModuleFileMetaData(ModuleFileType t, ModuleArchitecture ma,
+ long cs, long us) {
type = t;
+ modArch = ma;
csize = cs;
usize = us;
}
}
@@ -139,11 +150,12 @@
* requested module
*
* @throws IllegalArgumentException
* If the named module is not present in this repository
*/
- public abstract ModuleMetaData fetchMetaData(ModuleId mid) throws IOException;
+ public abstract ModuleFileMetaData fetchMetaData(ModuleId mid)
+ throws IOException;
/**
* Fetch the bytes for a given module.
*
* @param mid
@@ -153,8 +165,9 @@
* @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;
+ public abstract InputStream fetch(ModuleId mid)
+ throws IOException;
}