Package org.apache.aries.application.management.spi.repository

Examples of org.apache.aries.application.management.spi.repository.RepositoryGenerator


  private void generateOBRRepoXML(String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = context().getService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      mrs.add(modelledResourceManager.getModelledResource(bundleFile.toURI().toString(), jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
    }
View Full Code Here


  @Test
  public void testRepoAgain() throws Exception {
    // do not provision against the local runtime
    System.setProperty(AppConstants.PROVISON_EXCLUDE_LOCAL_REPO_SYSPROP, "true");
   
    RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
   
    String fileURI = new File(REPO_BUNDLE+".jar").toURI().toString();
    File repoXml = new File("repository.xml");
    if (repoXml.exists()) {
       repoXml.delete();
    }
    repositoryGenerator.generateRepository(new String[] {fileURI}, new FileOutputStream(repoXml));
   
    //print out the repository.xml
    BufferedReader reader = new BufferedReader(new FileReader(new File("repository.xml")));
    String line;
    while (( line = reader.readLine()) != null) {
View Full Code Here

  private void generateOBRRepoXML(boolean nullURI, String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = context().getService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      String uri = "";
      if (!!!nullURI) {
        uri = bundleFile.toURI().toString();
      }
      if ("delete.jar".equals(fileName)) {
        jarDir = null;
      }
      mrs.add(modelledResourceManager.getModelledResource(uri, jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
  }
View Full Code Here

 
  private void generateOBRRepoXML(boolean nullURI, String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = getOsgiService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = getOsgiService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      String uri = "";
      if (!!!nullURI) {
        uri = bundleFile.toURI().toString();
      }
      mrs.add(modelledResourceManager.getModelledResource(uri, jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
  }
View Full Code Here

  private void generateOBRRepoXML(String ... bundleFiles) throws Exception
  {
    Set<ModelledResource> mrs = new HashSet<ModelledResource>();
    FileOutputStream fout = new FileOutputStream("repository.xml");
    RepositoryGenerator repositoryGenerator = getOsgiService(RepositoryGenerator.class);
    ModelledResourceManager modelledResourceManager = getOsgiService(ModelledResourceManager.class);
    for (String fileName : bundleFiles) {
      File bundleFile = new File(fileName);
      IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
      mrs.add(modelledResourceManager.getModelledResource(bundleFile.toURI().toString(), jarDir));
    }
    repositoryGenerator.generateRepository("Test repo description", mrs, fout);
    fout.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.application.management.spi.repository.RepositoryGenerator

Copyright © 2018 www.massapicom. 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.