Package org.apache.aries.util.filesystem

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


             
          int last_slash = fullPath.lastIndexOf("/");
          appName = fullPath.substring(last_slash + 1, fullPath.length());
      }
                 
      IFile deploymentManifest = ebaFile.getFile(AppConstants.DEPLOYMENT_MF);
      /* We require that all other .jar and .war files included by-value be valid bundles
       * because a DEPLOYMENT.MF has been provided. If no DEPLOYMENT.MF, migrate
       * wars to wabs, plain jars to bundles
       */
      Set<BundleInfo> extraBundlesInfo = new HashSet<BundleInfo>();
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

     */
   
    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

   * @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

    zipRoot = other.zipRoot;
  }

  public IFile getFile(String name)
  {
    IFile result = null;

    String entryName = isZipRoot() ? name : getNameInZip() + "/" + name;

    ZipEntry entryFile = getEntry(entryName);
View Full Code Here

    assertNotNull(zip.getEntry("file.txt"));
    assertNotNull(zip.getEntry("subdir/someFile.txt"));
    zip.close();
   
    IDirectory dir = FileSystem.getFSRoot(new File("ioUtilsTest"));
    IFile izip = dir.getFile("test.zip");
    File output = new File("ioUtilsTest/zipout");
    output.mkdirs();
    IOUtils.unpackZip(izip, output);
    File a = new File(output,"file.txt");
    File b = new File(output,"subdir");
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

   */
  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

    zipRoot = other.zipRoot;
  }

  public IFile getFile(String name)
  {
    IFile result = null;
   
    String entryName = isZipRoot() ? name : getNameInZip() + "/" + name;
   
    ZipEntry entryFile = getEntry(entryName);
   
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.