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

Print this page

        

@@ -331,10 +331,33 @@
         throws IOException
     {
         catalog().gatherModuleIds(moduleName, mids);
     }
 
+    /**
+     * Find all module views and aliases with the given name and module
+     * architecture in this catalog.
+     */
+    public List<ModuleId> findlocalModuleIds(String moduleName,
+                                             ModuleArchitecture modArch)
+        throws IOException
+    {
+        Set<ModuleId> mids = new HashSet<>();
+        gatherLocalModuleIds(moduleName, modArch, mids);
+        List<ModuleId> rv = new ArrayList<>(mids);
+        Collections.sort(rv);
+        return rv;
+    }
+
+    protected void gatherLocalModuleIds(String moduleName,
+                                        ModuleArchitecture modArch,
+                                        Set<ModuleId> mids)
+        throws IOException
+    {
+        catalog().gatherModuleIds(moduleName, modArch, mids);
+    }
+
     @Override
     protected void gatherLocalDeclaringModuleIds(Set<ModuleId> mids)
         throws IOException
     {
         catalog().gatherDeclaringModuleIds(mids);

@@ -348,12 +371,12 @@
         return jms.parseModuleInfo(bs);
     }
 
     @Override
     public InputStream fetch(ModuleId mid) throws IOException {
-        ModuleMetaData mmd = fetchMetaData(mid);        
-        URI u = uri.resolve(mid.toString() + mmd.getType().getFileNameSuffix());
+        ModuleFileMetaData mfmd = fetchMetaData(mid);
+        URI u = uri.resolve(mid.toString() + mfmd.getType().getFileNameSuffix());
         if (tracing)
             trace(1, "fetching module %s", u);
         
         // special case file protocol for faster access
         if (u.getScheme().equalsIgnoreCase("file")) {

@@ -373,15 +396,15 @@
             return uc.getInputStream();
         }
     }
 
     @Override
-    public ModuleMetaData fetchMetaData(ModuleId mid) throws IOException {
+    public ModuleFileMetaData fetchMetaData(ModuleId mid) throws IOException {
         RepositoryCatalog.Entry e = catalog().get(mid);
         if (e == null)
             throw new IllegalArgumentException(mid.toString());
-        return new ModuleMetaData(e.type, e.csize, e.usize);
+        return new ModuleFileMetaData(e.type, e.modArch, e.csize, e.usize);
     }
     
     
     /**
      * Attempts to delete {@code f}. If the delete fails then the exception is