private URI releaseRepo(RepositoryPlugin releaseRepo, String jarName, InputStream jarStream) throws Exception { logger.debug("release to {}", releaseRepo.getName()); try { PutOptions putOptions = new RepositoryPlugin.PutOptions(); // TODO find sub bnd that is associated with this thing putOptions.context = this; PutResult r = releaseRepo.put(jarStream, putOptions); logger.debug("Released {} to {} in repository {}", jarName, r.artifact, releaseRepo); return r.artifact; } catch (Exception e) { msgs.Release_Into_Exception_(jarName, releaseRepo, e); return null; } }
private void repoPut(RepositoryPlugin writable, Project project, String file, String bsn, String version) throws Exception { File f = getFile(file); if (f.isFile()) { Jar jar = project.getValidJar(f); Manifest manifest = jar.getManifest(); if (bsn != null) manifest.getMainAttributes().putValue( Constants.BUNDLE_SYMBOLICNAME, bsn); if (version != null) manifest.getMainAttributes().putValue(Constants.BUNDLE_VERSION, version); writable.put(jar); } else error("There is no such file: " + f.getAbsolutePath()); }
private URI releaseRepo(RepositoryPlugin releaseRepo, String jarName, InputStream jarStream) throws Exception { logger.debug("release to {}", releaseRepo.getName()); try { PutOptions putOptions = new RepositoryPlugin.PutOptions(); // TODO find sub bnd that is associated with this thing putOptions.context = this; PutResult r = releaseRepo.put(jarStream, putOptions); logger.debug("Released {} to {} in repository {}", jarName, r.artifact, releaseRepo); return r.artifact; } catch (Exception e) { msgs.Release_Into_Exception_(jarName, releaseRepo, e); return null; } }
private void repoPut(RepositoryPlugin writable, Project project, String file, String bsn, String version) throws Exception { Jar jar = null; int n = file.indexOf(':'); if (n > 1 && n < 10) { jar = project.getValidJar(new URL(file)); } else { File f = getFile(file); if (f.isFile()) { jar = project.getValidJar(f); } } if (jar != null) { Manifest manifest = jar.getManifest(); if (bsn != null) manifest.getMainAttributes().putValue(Constants.BUNDLE_SYMBOLICNAME, bsn); if (version != null) manifest.getMainAttributes().putValue(Constants.BUNDLE_VERSION, version); writable.put(jar); } else error("There is no such file or url: " + file); }
public void copy(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) throws Exception { assert source != null; assert destination != null; logger.info("copy from repo {} to {} with filter {}", source, destination, filter); for (String bsn : source.list(null)) { for (Version version : source.versions(bsn)) { if (filter == null || filter.matches(bsn)) { logger.info("copy {}:{}", bsn, version); File file = source.get(bsn, version, null); if (file.getName() .endsWith(".jar")) { try (InputStream in = IO.stream(file)) { PutOptions po = new PutOptions(); po.bsn = bsn; po.context = null; po.type = "bundle"; po.version = version; PutResult put = destination.put(in, po); } catch (Exception e) { logger.error("Failed to copy {}-{}", e, bsn, version); error("Failed to copy %s:%s from %s to %s, error: %s", bsn, version, source, destination, e); } } } } } }
public void copy(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) throws Exception { assert source != null; assert destination != null; logger.info("copy from repo {} to {} with filter {}", source, destination, filter); for (String bsn : source.list(null)) { for (Version version : source.versions(bsn)) { if (filter == null || filter.matches(bsn)) { logger.info("copy {}:{}", bsn, version); File file = source.get(bsn, version, null); if (file.getName() .endsWith(".jar")) { try (InputStream in = IO.stream(file)) { PutOptions po = new PutOptions(); po.bsn = bsn; po.context = null; po.type = "bundle"; po.version = version; PutResult put = destination.put(in, po); } catch (Exception e) { logger.error("Failed to copy {}-{}", e, bsn, version); error("Failed to copy %s:%s from %s to %s, error: %s", bsn, version, source, destination, e); } } } } } }
private void install(File f, RepositoryPlugin repo, Attrs value) throws Exception { try (Processor p = new Processor()) { p.getProperties() .putAll(value); PutOptions options = new PutOptions(); options.context = p; try (InputStream in = IO.stream(f)) { repo.put(in, options); } catch (Exception e) { exception(e, "Cannot install %s into %s because %s", f, repo.getName(), e); } } }
rp.put(new BufferedInputStream(new FileInputStream(file)), new RepositoryPlugin.PutOptions()); return;
rp.put(new BufferedInputStream(new FileInputStream(file)), new RepositoryPlugin.PutOptions()); return;
private void install(File f, RepositoryPlugin repo, Attrs value) throws Exception { try (Processor p = new Processor()) { p.getProperties() .putAll(value); PutOptions options = new PutOptions(); options.context = p; try (InputStream in = IO.stream(f)) { repo.put(in, options); } catch (Exception e) { exception(e, "Cannot install %s into %s because %s", f, repo.getName(), e); } } }
rp.put(new BufferedInputStream(new FileInputStream(file)), new RepositoryPlugin.PutOptions()); return;
rp.put(new BufferedInputStream(IO.stream(file)), new RepositoryPlugin.PutOptions()); return; } catch (Exception e) {
rp.put(new BufferedInputStream(IO.stream(file)), new RepositoryPlugin.PutOptions()); return; } catch (Exception e) {
Jar jar = new Jar(file); try { rp.put(jar); return; } catch (Exception e) {
Jar jar = new Jar(file); try { rp.put(jar); return; } catch (Exception e) {
return rp.put(jar); } catch (Exception e) { error("Deploying " + jar.getName() + " on " + rp.getName(), e);
public URI releaseURI(String name, String jarName, InputStream jarStream) throws Exception { // Blank repository name means no release if ("".equals(name)) { return null; } trace("release to %s", name); RepositoryPlugin repo = getReleaseRepo(name); if (repo == null) { if (name == null) msgs.NoNameForReleaseRepository(); else msgs.ReleaseRepository_NotFoundIn_(name, getPlugins(RepositoryPlugin.class)); return null; } try { PutResult r = repo.put(jarStream, new RepositoryPlugin.PutOptions()); trace("Released %s to %s in repository %s", jarName, r.artifact, repo); return r.artifact; } catch (Exception e) { msgs.Release_Into_Exception_(jarName, repo, e); return null; } }
public URI releaseURI(String name, String jarName, InputStream jarStream) throws Exception { // Blank repository name means no release if ("".equals(name)) { return null; } trace("release to %s", name); RepositoryPlugin repo = getReleaseRepo(name); if (repo == null) { if (name == null) msgs.NoNameForReleaseRepository(); else msgs.ReleaseRepository_NotFoundIn_(name, getPlugins(RepositoryPlugin.class)); return null; } try { PutResult r = repo.put(jarStream, new RepositoryPlugin.PutOptions()); trace("Released %s to %s in repository %s", jarName, r.artifact, repo); return r.artifact; } catch (Exception e) { msgs.Release_Into_Exception_(jarName, repo, e); return null; } }
PutResult r = rp.put(jarStream, new RepositoryPlugin.PutOptions()); trace("Released %s to %s in repository %s", jarName, r.artifact, rp);
File file = rp.put(jar); trace("Released %s to file %s in repository %s", jar.getName(), file, rp); } catch (Exception e) {