Examples of JarEntry


Examples of java.util.jar.JarEntry

    JarFile jar;
    try {
      jar = new JarFile(jarFile);
      Enumeration<JarEntry> jarEntries = jar.entries();
      while (jarEntries.hasMoreElements()) {
        JarEntry jarEntry = jarEntries.nextElement();
        String jarEntryName = jarEntry.getName();
        // Check if this entry is a language file
        for (String i18nKey : toCopyI18nKeys) {
          if (jarEntryName.endsWith(I18N_DIRNAME + "/" + I18nModule.LOCAL_STRINGS_FILE_PREFIX + i18nKey + I18nModule.LOCAL_STRINGS_FILE_POSTFIX)) {
            File targetBaseDir;
            // Special case: copy brasato files to brasato
View Full Code Here

Examples of java.util.jar.JarEntry

        // Add all bundles in the current language
        for (String bundleName : I18nModule.getBundleNamesContainingI18nFiles()) {
          Properties propertyFile = getPropertiesWithoutResolvingRecursively(locale, bundleName);
          String entryFileName = bundleName.replace(".", "/") + "/" + I18N_DIRNAME + "/" + buildI18nFilename(locale);
          // Create jar entry for this path, name and last modified
          JarEntry jarEntry = new JarEntry(entryFileName);
          jarEntry.setTime(now);
          // Write properties to jar file
          out.putNextEntry(jarEntry);
          propertyFile.store(out, null);
          if (isLogDebugEnabled()) {
            logDebug("Adding file::" + entryFileName + " + to jar", null);
View Full Code Here

Examples of java.util.jar.JarEntry

      else jos = new JarOutputStream(fos);

      // process all modules
      TargetModuleInfo moduleInfo = new TargetModuleInfo();
      ModuleType moduleType = null;
      JarEntry entry = jis.getNextJarEntry();
      while (entry != null)
      {
         String entryName = entry.getName();

         // only process file entries
         if (entryName.endsWith("/") == false)
         {
            moduleType = ifNotNull(determineModuleType(entryName), moduleType);
View Full Code Here

Examples of java.util.jar.JarEntry

      if (manifest != null)
         jos = new JarOutputStream(fos, manifest);
      else jos = new JarOutputStream(fos);

      // now copy entry by entry
      JarEntry entry = jisModule.getNextJarEntry();
      while (entry != null)
      {
         String subEntryName = entry.getName();
         if (mapDeploymentPlan.get(entryName + "!/" + subEntryName) == null)
            JarUtils.addJarEntry(jos, subEntryName, jisModule);
         else log.debug("Skip entry found in deployment plan: " + subEntryName);

         entry = jisModule.getNextJarEntry();
View Full Code Here

Examples of java.util.jar.JarEntry

      // process the deployment plan
      try
      {
         JarInputStream jarDeploymentPlan = new JarInputStream(deploymentPlan);
         JarEntry entry = jarDeploymentPlan.getNextJarEntry();
         while (entry != null)
         {
            String entryName = entry.getName();
            log.debug("unpack deployment plan entry: " + entryName);

            File tempFile = getTempFile(entryName);
            dpMap.put(entryName, tempFile);
View Full Code Here

Examples of java.util.jar.JarEntry

      String jarName = jar.getFile();
      JarFile jf = new JarFile(jarName);
      Enumeration entries = jf.entries();
      while( entries.hasMoreElements() )
      {
         JarEntry entry = (JarEntry) entries.nextElement();
         String name = entry.getName();
         if( name.endsWith(".class") && name.startsWith(pkgPrefix) )
         {
            name = name.substring(0, name.length() - 6);
            String classname = name.replace('/', '.');
            try
View Full Code Here

Examples of java.util.jar.JarEntry

          jar = new JarFile(file);
          Enumeration<JarEntry> jarEntries = jar.entries();
          // Check in all jars - maybe we have context help files in
          // jar resources
          while (jarEntries.hasMoreElements()) {
            JarEntry jarEntry = jarEntries.nextElement();
            String jarEntryName = jarEntry.getName();
            // TODO:FG: check for \\ instead of / for windows, rare case
            if (jarEntryName.indexOf("/" + CHELP_DIR + "/") != -1) {
              if (!jarEntry.isDirectory()) {
                // Add file from jar to help page list
                // extract class name without trailing slashes
                int staticDirPos = jarEntryName.indexOf(CHELP_DIR);
                String packageName = jarEntryName.substring(0, staticDirPos - 1);
                packageName = packageName.replace("/", ".");
View Full Code Here

Examples of java.util.jar.JarEntry

            FileOutputStream fos = new FileOutputStream(file);
            JarOutputStream jos = new JarOutputStream(fos, mf);
            Enumeration entries = jarFile.entries();
            while( entries.hasMoreElements() )
            {
               JarEntry entry = (JarEntry) entries.nextElement();
               String name = entry.getName();
               if( name.equals("META-INF/MANIFEST.MF") )
               {
                  continue;
               }

               JarEntry outEntry = new JarEntry(entry.getName());
               outEntry.setTime(entry.getTime());
               if( entry.getComment() != null )
                  outEntry.setComment(entry.getComment());
               jos.putNextEntry(outEntry);
               InputStream is = jarFile.getInputStream(entry);
               int bytes = is.read(buffer);
               while( bytes > 0 )
               {
View Full Code Here

Examples of java.util.jar.JarEntry

         is = getFile().openStream();
         if (is instanceof JarInputStream)
         {
            JarInputStream jis = (JarInputStream)is;
            JarOutputStream os = new JarOutputStream(bos);
            JarEntry je = null;
            while ((je = jis.getNextJarEntry()) != null)
            {
               if (filter != null && filter.accept(je.getName()))
               {
                  os.putNextEntry(je);
                  VFSUtils.copyStream(jis, os);
               }
            }
View Full Code Here

Examples of java.util.jar.JarEntry

    InputStream classInputStream = null;
    if (this.extensionJars != null) {
      // Check if searched class is an extension class
      for (int i = 0; i < this.extensionJars.length; i++) {
        JarFile extensionJar = this.extensionJars [i];
        JarEntry jarEntry = extensionJar.getJarEntry(classFile);
        if (jarEntry != null) {
          try {
            classInputStream = extensionJar.getInputStream(jarEntry);
          } catch (IOException ex) {
            throw new ClassNotFoundException("Couldn't read class " + name, ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.