@Test public void testGetAllPackage() throws IOException { File r1Path = new File(tmpDir, "r1"); HeliumLocalRegistry r1 = new HeliumLocalRegistry("r1", r1Path.getAbsolutePath()); assertEquals(0, r1.getAll().size()); Gson gson = new Gson(); HeliumPackage pkg1 = new HeliumPackage(HeliumPackage.Type.APPLICATION, "app1", "desc1", "artifact1", "classname1", new String[][]{}, "license", ""); FileUtils.writeStringToFile(new File(r1Path, "pkg1.json"), gson.toJson(pkg1)); assertEquals(1, r1.getAll().size()); }
@Override public synchronized List<HeliumPackage> getAll() throws IOException { List<HeliumPackage> result = new LinkedList<>(); File file = new File(uri()); File [] files = file.listFiles(); if (files == null) { return result; } for (File f : files) { if (f.getName().startsWith(".")) { continue; } HeliumPackage pkgInfo = readPackageInfo(f); if (pkgInfo != null) { result.add(pkgInfo); } } return result; }
HeliumLocalRegistry extends HeliumRegistry { @Override public synchronized List<HeliumPackage> getAll() throws IOException { List<HeliumPackage> result = new LinkedList<>(); File file = new File(uri()); File [] files = file.listFiles(); if (files == null) { return result; } for (File f : files) { if (f.getName().startsWith(".")) { continue; } HeliumPackage pkgInfo = readPackageInfo(f); if (pkgInfo != null) { result.add(pkgInfo); } } return result; } }
HeliumLocalRegistry extends HeliumRegistry { @Override public synchronized List<HeliumPackage> getAll() throws IOException { List<HeliumPackage> result = new LinkedList<>(); File file = new File(uri()); File [] files = file.listFiles(); if (files == null) { return result; } for (File f : files) { if (f.getName().startsWith(".")) { continue; } HeliumPackage pkgInfo = readPackageInfo(f); if (pkgInfo != null) { result.add(pkgInfo); } } return result; } HeliumLocalRegistry(String name, String uri); }
HeliumLocalRegistry extends HeliumRegistry { @Override public synchronized List<HeliumPackage> getAll() throws IOException { List<HeliumPackage> result = new LinkedList<>(); File file = new File(uri()); File [] files = file.listFiles(); if (files == null) { return result; } for (File f : files) { if (f.getName().startsWith(".")) { continue; } HeliumPackage pkgInfo = readPackageInfo(f); if (pkgInfo != null) { result.add(pkgInfo); } } return result; } HeliumLocalRegistry(String name, String uri); @Override synchronized List<HeliumPackage> getAll(); }
HeliumLocalRegistry extends HeliumRegistry { @Override public synchronized List<HeliumPackage> getAll() throws IOException { List<HeliumPackage> result = new LinkedList<>(); File file = new File(uri()); File [] files = file.listFiles(); if (files == null) { return result; } for (File f : files) { if (f.getName().startsWith(".")) { continue; } HeliumPackage pkgInfo = readPackageInfo(f); if (pkgInfo != null) { result.add(pkgInfo); } } return result; } HeliumLocalRegistry(String name, String uri); @Override synchronized List<HeliumPackage> getAll();  }