public Workspace(File dir) throws Exception { dir = dir.getAbsoluteFile(); dir.mkdirs(); assert dir.isDirectory(); File buildDir = new File(dir, BNDDIR).getAbsoluteFile(); if (!buildDir.isDirectory()) buildDir = new File(dir, CNFDIR).getAbsoluteFile(); this.buildDir = buildDir; File buildFile = new File(buildDir, BUILDFILE).getAbsoluteFile(); if (!buildFile.isFile()) warning("No Build File in " + dir); setProperties(buildFile, dir); propertiesChanged(); cachedRepo = new CachedFileRepo(); }
CachedFileRepo repo = new CachedFileRepo(); list.add(repo);
@Override protected boolean init() throws Exception { if (lock.tryLock(50, TimeUnit.SECONDS) == false) throw new TimeLimitExceededException("Cached File Repo is locked and can't acquire it"); try { if (super.init()) { inited = true; if (!root.exists() && !root.mkdirs()) { throw new IOException("Could not create cache directory " + root); } if (!root.isDirectory()) throw new IllegalArgumentException("Cache directory " + root + " not a directory"); InputStream in = getClass().getResourceAsStream(EMBEDDED_REPO); if (in != null) unzip(in, root); else { if (root.isDirectory() && root.list().length >= 2) { trace("Assuming I am in a bnd test ... the embedded repo is missig but it exists on the file system"); return true; } error("Couldn't find embedded-repo.jar in bundle "); } return true; } else return false; } finally { lock.unlock(); } }
@Override protected boolean init() throws Exception { if (lock.tryLock(50, TimeUnit.SECONDS) == false) throw new TimeLimitExceededException("Cached File Repo is locked and can't acquire it"); try { if (super.init()) { inited = true; if (!root.exists() && !root.mkdirs()) { throw new IOException("Could not create cache directory " + root); } if (!root.isDirectory()) throw new IllegalArgumentException("Cache directory " + root + " not a directory"); InputStream in = getClass().getResourceAsStream(EMBEDDED_REPO); if (in != null) unzip(in, root); else { if (root.isDirectory() && root.list().length >= 2) { trace("Assuming I am in a bnd test ... the embedded repo is missig but it exists on the file system"); return true; } error("Couldn't find embedded-repo.jar in bundle "); } return true; } else return false; } finally { lock.unlock(); } }
CachedFileRepo repo = new CachedFileRepo(); list.add(repo);
@Override protected void setTypeSpecificPlugins(Set<Object> list) { try { super.setTypeSpecificPlugins(list); list.add(this); list.add(maven); list.add(settings); if (!isTrue(getProperty(NOBUILDINCACHE))) { list.add(new CachedFileRepo()); } resourceRepositoryImpl = new ResourceRepositoryImpl(); resourceRepositoryImpl.setCache(IO.getFile(getProperty(CACHEDIR, "~/.bnd/caches/shas"))); resourceRepositoryImpl.setExecutor(getExecutor()); resourceRepositoryImpl.setIndexFile(getFile(buildDir, "repo.json")); resourceRepositoryImpl.setURLConnector(new MultiURLConnectionHandler(this)); customize(resourceRepositoryImpl, null); list.add(resourceRepositoryImpl); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
@Override protected boolean init() throws Exception { if (lock.tryLock(50, TimeUnit.SECONDS) == false) throw new TimeLimitExceededException("Cached File Repo is locked and can't acquire it"); try { if (super.init()) { inited = true; if (!root.exists() && !root.mkdirs()) { throw new IOException("Could not create cache directory " + root); } if (!root.isDirectory()) throw new IllegalArgumentException("Cache directory " + root + " not a directory"); InputStream in = getClass().getResourceAsStream(EMBEDDED_REPO); if (in != null) unzip(in, root); else { error("Couldn't find embedded-repo.jar in bundle "); } return true; } else return false; } finally { lock.unlock(); } }
@Override protected void setTypeSpecificPlugins(Set<Object> list) { try { super.setTypeSpecificPlugins(list); list.add(this); list.add(maven); list.add(settings); if (!isTrue(getProperty(NOBUILDINCACHE))) { list.add(new CachedFileRepo()); } resourceRepositoryImpl = new ResourceRepositoryImpl(); resourceRepositoryImpl.setCache(IO.getFile(getProperty(CACHEDIR, "~/.bnd/caches/shas"))); resourceRepositoryImpl.setExecutor(getExecutor()); resourceRepositoryImpl.setIndexFile(getFile(buildDir, "repo.json")); resourceRepositoryImpl.setURLConnector(new MultiURLConnectionHandler(this)); customize(resourceRepositoryImpl, null); list.add(resourceRepositoryImpl); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
protected void init() throws Exception { if (lock.tryLock(50, TimeUnit.SECONDS) == false) throw new TimeLimitExceededException( "Cached File Repo is locked and can't acquire it"); try { if (!inited) { inited = true; root.mkdirs(); if (!root.isDirectory()) throw new IllegalArgumentException("Cannot create cache dir " + root); InputStream in = getClass().getResourceAsStream(EMBEDDED_REPO); if (in != null) unzip(in, root); else { System.out.println("!!!! Couldn't find embedded-repo.jar in bundle "); error("Couldn't find embedded-repo.jar in bundle "); } } } finally { lock.unlock(); } }
public void syncCache() throws Exception { CachedFileRepo cf = new CachedFileRepo(); cf.init(); cf.close(); }
public void syncCache() throws Exception { CachedFileRepo cf = new CachedFileRepo(); cf.init(); cf.close(); }
public void syncCache() throws Exception { CachedFileRepo cf = new CachedFileRepo(); cf.init(); cf.close(); }
public void syncCache() throws Exception { CachedFileRepo cf = new CachedFileRepo(); cf.init(); cf.close(); }
@Override protected void setTypeSpecificPlugins(Set<Object> list) { super.setTypeSpecificPlugins(list); list.add(maven); list.add(new CachedFileRepo()); }