Package org.apache.aries.application.filesystem

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


   */
  public void runBasicDirTest(IDirectory dir, long len, long time) throws IOException
  {
    assertNull("for some reason our fake app has a fake blueprint file.", dir.getFile("OSGI-INF/blueprint/aries.xml"));
   
    IFile file = dir.getFile(AppConstants.APPLICATION_MF);
   
    assertNotNull("we could not find the application manifest", file);
   
    assertEquals(AppConstants.APPLICATION_MF, file.getName().replace('\\', '/'));
    assertTrue("The last update time is not within 2 seconds of the expected value. Expected: " + time + " Actual: " + file.getLastModified(), Math.abs(time - file.getLastModified()) < 2000);
    assertEquals(len, file.getSize());
    assertEquals("META-INF", file.getParent().getName());
    assertFalse(file.isDirectory());
    assertTrue(file.isFile());
   
    List<IFile> files = dir.listFiles();
    Iterator<IFile> it = files.iterator();
    while (it.hasNext()) {
      IFile f = it.next();
      if (f.getName().equalsIgnoreCase(".svn")) {
        it.remove();
      }
    }
   
    assertEquals(1, files.size());
   
    IFile metaInf = files.get(0);
   
    assertTrue(metaInf.isDirectory());
    assertEquals("META-INF", metaInf.getName());
    assertNotNull(metaInf.convert());
   
    for (IFile aFile : dir) {
      if (!aFile.getName().equalsIgnoreCase(".svn")) {
        assertTrue(aFile.isDirectory());
        assertEquals("META-INF", aFile.getName());
        assertNotNull(aFile.convert());
      }
    }
   
    InputStream is = file.open();
   
    Manifest man = new Manifest(is);
    //remember to close the input stream after use
    is.close();
    assertEquals("com.travel.reservation", man.getMainAttributes().getValue("Application-SymbolicName"));
   
    IFile applicationMF2 = dir.getFile(AppConstants.APPLICATION_MF);
   
    Assert.assertEqualsContract(file, applicationMF2, dir);
    Assert.assertHashCodeEquals(file, applicationMF2, true);
  }
View Full Code Here


             
          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

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.