Package org.apache.aries.application.filesystem

Examples of org.apache.aries.application.filesystem.IFile


                                       JarFile jarFile,
                                       ModuleIDBuilder idBuilder)
        throws IOException, DeploymentException {
        ApplicationMetadataFactory factory = getApplicationMetadataFactory();
        IDirectory ebaFile = FileSystem.getFSRoot(new File(jarFile.getName()));
        IFile applicationManifestFile = ebaFile.getFile(AppConstants.APPLICATION_MF);
        Manifest applicationManifest;
        if (applicationManifestFile != null) {
            InputStream in = applicationManifestFile.open();
            try {
                applicationManifest = ManifestProcessor.parseManifest(in);
            } finally {
                try { in.close(); } catch (IOException ignore) {}
            }
View Full Code Here


  }

  public IFile getFile(String name)
  {
    File desiredFile = new File(file, name);
    IFile result = null;
   
    if (desiredFile.exists())
    {
        if(!desiredFile.isDirectory())
          result = new FileImpl(desiredFile, rootDirFile);
View Full Code Here

    root = this;
  }

  public IFile getFile(String name)
  {
    IFile result = null;
   
    String entryName = isRoot() ? name : getName() + "/" + name;
   
    ZipEntry entryFile = getEntry(entryName);
   
View Full Code Here

   * @param manifestName the name of manifest
   * @return Manifest, or null if none found.
   * @throws IOException
   */
  public static Manifest obtainManifestFromAppDir(IDirectory appDir, String manifestName) throws IOException{
    IFile manifestFile = appDir.getFile(manifestName);
    Manifest man = null;
    if (manifestFile != null) {
      man = parseManifest(manifestFile.open());
    }
    return man;
  }
View Full Code Here

        BundleManifest bundleMf = BundleManifest.fromBundle(appBundle);
        BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
        List<IFile> files = appBundle.listAllFiles();
        Iterator<IFile> it = files.iterator();
        while (it.hasNext()) {
          IFile file = (IFile) it.next();        
          String directoryFullPath = file.getName();
          String directoryName = "";
          String fileName = "";
          if (directoryFullPath.lastIndexOf("/") != -1) {
            directoryName = directoryFullPath.substring(0, directoryFullPath.lastIndexOf("/"));
            fileName = directoryFullPath.substring(directoryFullPath.lastIndexOf("/") + 1);
          } else {
            if (file.isFile()) {
              directoryName="";
              fileName = directoryFullPath;
            }

          }
View Full Code Here

     */
   
    IDirectory storedEba = FileSystem.getFSRoot(dest);
    assertNotNull (storedEba);
    assertEquals (storedEba.listFiles().size(), 3);
    IFile ifile = storedEba.getFile("META-INF/APPLICATION.MF");
    assertNotNull (ifile);
    ifile = storedEba.getFile ("META-INF/DEPLOYMENT.MF");
    assertNotNull (ifile);
    ifile = storedEba.getFile ("foo.bar.widgets.jar");
    assertNotNull (ifile);
View Full Code Here

    try {
      Manifest applicationManifest = parseApplicationManifest (ebaFile);
      ManifestDefaultsInjector.updateManifest(applicationManifest, ebaFile.getName(), ebaFile);
      applicationMetadata = _applicationMetadataFactory.createApplicationMetadata(applicationManifest);

      IFile deploymentManifest = ebaFile.getFile(AppConstants.DEPLOYMENT_MF);
      if (deploymentManifest != null) {
        deploymentMetadata = _deploymentMetadataFactory.createDeploymentMetadata(deploymentManifest);
       
        // Validate: symbolic names must match
        String appSymbolicName = applicationMetadata.getApplicationSymbolicName();
View Full Code Here

   * @return parsed manifest, or an empty Manifest
   * @throws IOException
   */
  private Manifest parseApplicationManifest (IDirectory source) throws IOException {
    Manifest result = new Manifest();
    IFile f = source.getFile(AppConstants.APPLICATION_MF);
    if (f != null) {
      InputStream is = null;
      try {
        is = f.open();
        result = ManifestProcessor.parseManifest(is);
      } catch (IOException iox) {
        _logger.error ("APPMANAGEMENT0007E", new Object[]{source.getName(), iox});
        throw iox;
      } finally {
View Full Code Here

  }

  public IFile getFile(String name)
  {
    File desiredFile = new File(file, name);
    IFile result = null;
   
    if (desiredFile.exists())
    {
        if(!desiredFile.isDirectory())
          result = new FileImpl(desiredFile, rootDirFile);
View Full Code Here

   */
  public static BundleManifest fromBundle(IFile f) {
    InputStream is = null;
    try {
      if (f.isDirectory()) {
        IFile manFile = f.convert().getFile(MANIFEST_PATH);
        if (manFile != null)
          return new BundleManifest(manFile.open());
        else
          return null;
      } else {
        is = f.open();
        return fromBundle(is);
View Full Code Here

TOP

Related Classes of org.apache.aries.application.filesystem.IFile

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.