Package org.osgi.service.bindex

Examples of org.osgi.service.bindex.BundleIndexer.index()


    public void index(Set<File> jarFiles, OutputStream out, Map<String,String> config) throws Exception {
        BundleIndexer service = (BundleIndexer) waitForService(500);
        if (service == null)
            throw new IllegalStateException("Bundle Indexer service is not available.");

        service.index(jarFiles, out, config);
    }

}
View Full Code Here


    public void index(Set<File> jarFiles, OutputStream out, Map<String,String> config) throws Exception {
        BundleIndexer service = waitForService(500);
        if (service == null)
            throw new IllegalStateException("Bundle Indexer service is not available.");

        service.index(jarFiles, out, config);
    }
}
View Full Code Here

      out = new FileOutputStream(localIndex);
      if (!allFiles.isEmpty()) {
        Map<String, String> config = new HashMap<String, String>();
        config.put(BundleIndexer.REPOSITORY_NAME, this.getName());
        config.put(BundleIndexer.ROOT_URL, localIndex.getCanonicalFile().toURI().toURL().toString());
        indexer.index(allFiles, out, config);
      } else {
        ByteArrayInputStream emptyRepo = new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>\n<repository lastmodified='0'/>".getBytes());
        IO.copy(emptyRepo, out);
      }
    } finally {
View Full Code Here

    ByteArrayOutputStream newIndexBuffer = new ByteArrayOutputStream();

    Map<String, String> config = new HashMap<String, String>();
    config.put(BundleIndexer.REPOSITORY_NAME, this.getName());
    config.put(BundleIndexer.ROOT_URL, localIndex.getCanonicalFile().toURI().toURL().toString());
    indexer.index(Collections.singleton(newFile.getCanonicalFile()), newIndexBuffer, null);
   
    // Merge into main index
    File tempIndex = File.createTempFile("repository", ".xml");
    FileOutputStream tempIndexOutput = new FileOutputStream(tempIndex);
    MergeContentFilter merger = new MergeContentFilter();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.