private Collection<File> toFiles(Collection<Container> path) { List<File> result = new ArrayList<File>(path.size()); for (Container c : path) { if (c.getError() == null) { result.add(c.getFile()); } } return result; }
public void addBundles(File bndrun) throws Exception { Run run = Run.createRun(getWorkspace(), bndrun); List<Bundle> bundles = new ArrayList<>(); for (Container c : run.getRunbundles()) { assert c.getError() == null; Bundle bundle = context.installBundle(c.getFile() .toURI() .toString()); bundles.add(bundle); } startAll(bundles); }
public void addBundles(File bndrun) throws Exception { Run run = Run.createRun(getWorkspace(), bndrun); List<Bundle> bundles = new ArrayList<>(); for (Container c : run.getRunbundles()) { assert c.getError() == null; Bundle bundle = context.installBundle(c.getFile() .toURI() .toString()); bundles.add(bundle); } startAll(bundles); }
/** * Answer the manifest for this container (if possible). Manifest is cached * until the file is renewed. */ public Manifest getManifest() throws Exception { if (getError() != null || getFile() == null) return null; if (manifestTime < getFile().lastModified()) { try (JarInputStream jin = new JarInputStream(IO.stream(getFile()))) { manifest = jin.getManifest(); } manifestTime = getFile().lastModified(); } return manifest; }
/** * Answer the manifest for this container (if possible). Manifest is cached * until the file is renewed. */ public Manifest getManifest() throws Exception { if (getError() != null || getFile() == null) return null; if (manifestTime < getFile().lastModified()) { try (JarInputStream jin = new JarInputStream(IO.stream(getFile()))) { manifest = jin.getManifest(); } manifestTime = getFile().lastModified(); } return manifest; }
private void verifyDependencies(String title, Collection<Container> path) throws Exception { List<String> msgs = new ArrayList<String>(); for (Container c : new ArrayList<Container>(path)) { for (Container cc : c.getMembers()) { if (cc.getError() != null) msgs.add(cc + " - " + cc.getError()); else if (!cc.getFile().isFile() && !cc.getFile().equals(cc.getProject().getOutput()) && !cc.getFile().equals(cc.getProject().getTestOutput())) msgs.add(cc + " file does not exists: " + cc.getFile()); } } if (msgs.isEmpty()) return; error("%s: has errors: %s", title, Strings.join(msgs)); }
private void verifyDependencies(String title, Collection<Container> path) throws Exception { List<String> msgs = new ArrayList<String>(); for (Container c : new ArrayList<Container>(path)) { for (Container cc : c.getMembers()) { if (cc.getError() != null) msgs.add(cc + " - " + cc.getError()); else if (!cc.getFile().isFile() && !cc.getFile().equals(cc.getProject().getOutput()) && !cc.getFile().equals(cc.getProject().getTestOutput())) msgs.add(cc + " file does not exists: " + cc.getFile()); } } if (msgs.isEmpty()) return; error("%s: has errors: %s", title, Strings.join(msgs)); }
public String getColumnText(Object element, int columnIndex) { Container c = (Container) element; switch (columnIndex) { case 0: return c.getBundleSymbolicName(); case 1: return c.getVersion(); case 2: return c.getError(); case 3: return c.getFile() + " (" + (c.getFile()!=null && c.getFile().exists() ? "exists" : "?") + ")"; } return null; }
public String getColumnText(Object element, int columnIndex) { Container c = (Container) element; switch (columnIndex) { case 0: return c.getBundleSymbolicName(); case 1: return c.getVersion(); case 2: return c.getError(); case 3: return c.getFile() + " (" + (c.getFile()!=null && c.getFile().exists() ? "exists" : "?") + ")"; } return null; }