Package org.apache.aries.util.filesystem

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


    }
   
    @Override
    protected URL findResource(String resName) {
      for(IDirectory id : classpath) {
        IFile f = id.getFile(resName);
        if(f != null)
          try {
            return f.toURL();
          } catch (MalformedURLException e) {
            logger.error("Error getting URL for file " + f, e);
          }
      }
      return null;
View Full Code Here


    String ejbJarLocation = (manifest.getRawAttributes().getValue(
        "Web-ContextPath") == null) ? "META-INF/ejb-jar.xml" : "WEB-INF/ejb-jar.xml";
   
    try {
      //If we have an ejb-jar.xml then parse it
      IFile file = bundle.getFile(ejbJarLocation);
      EjbJar ejbJar = (file == null) ? new EjbJar() : ReadDescriptors.readEjbJar(file.toURL());
     
      EjbModule module = new EjbModule(ejbJar);
     
      //We build our own because we can't trust anyone to get the classpath right otherwise!
      module.setFinder(new IDirectoryFinder(AnnotationDeployer.class.getClassLoader(),
View Full Code Here

        String name = nvp.getName().trim();
        if(".".equals(name)) {
          result.add(bundle);
        }
        else {
          IFile f = bundle.getFile(name);
         
          if(f==null) {
            //This possibly just means no directory entries in a
            //Zip. Check to make sure
            if(allFiles == null)
              allFiles = bundle.listAllFiles();
           
            for(IFile file : allFiles) {
              if(file.getName().startsWith(name)) {
                 result.add(new ClasspathIDirectory(bundle, name));
                 break;
              }
            }
           
          } else {
            IDirectory converted = f.convertNested();
            if(converted != null)
              result.add(converted);
          }
        }
      }
View Full Code Here

    Collection<IFile> blueprints = new ArrayList<IFile>();
    BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
    List<IFile> files = bundle.listAllFiles();
    Iterator<IFile> it = files.iterator();
    while (it.hasNext()) {
        IFile file = it.next();        
        String directoryFullPath = file.getName();
        String directoryName = "";
        String fileName = "";
        if (directoryFullPath.lastIndexOf("/") != -1) {
          // This bundle may be nested within another archive. In that case, we need to trim
          // /bundleFileName.jar from the front of the directory.
          int bundleNameLength = bundle.getName().length();
            directoryName = directoryFullPath.substring(bundleNameLength, directoryFullPath.lastIndexOf("/"));
            if (directoryName.startsWith("/") && directoryName.length() > 1) {
              directoryName = directoryName.substring(1);
            }
            fileName = directoryFullPath.substring(directoryFullPath.lastIndexOf("/") + 1);
        } else {
            if (file.isFile()) {
                directoryName="";
                fileName = directoryFullPath;
            }

        }
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.util.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.