Package java.util.jar

Examples of java.util.jar.JarFile.entries()


      // alle Archive durchgehen
      for (i=0; i<list.length; i++) {
       
        jar = new JarFile(this.source + list[i]);
       
        content = jar.entries();
       
        // alle Klassen eines Archivs durchgehen
        while ( content.hasMoreElements() ) {
         
          entry = (JarEntry)content.nextElement();
View Full Code Here


      for (int i=0; i<list.length; i++) {
       
        this.logln("\n unpack "+ list[i] +":");
       
        jar = new JarFile(path + list[i]);
        content = jar.entries();
       
        file = new File(path + list[i]);
        jarDate = ( file.lastModified() < 0 ) ? "unknown" : sdf.format(new Date(file.lastModified()))
       
        // alle Klassen eines Archivs durchgehen
View Full Code Here

    if ( tobeJared==null ) throw new Exception("array of files is null");
    if ( tobeJared.length==0 ) throw new Exception("no files to archive");
   
  // Inhalt des bestehenden jars auslesen
    JarFile jar = new JarFile(jarFile);
    Enumeration jarEnum = jar.entries();
    Hashtable jarContent = new Hashtable();
   
    String elem;
    // alle Dateien eines Archivs durchgehen
    while ( jarEnum.hasMoreElements() ) {
View Full Code Here

  public static String autoDetectPackageName(File file) {
    try {
      Set<String> packageNames = new HashSet<String>();
      JarFile jarFile = new JarFile(file);
      Enumeration<JarEntry> entries = jarFile.entries();
      while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        String name = entry.getName();
        if (name.endsWith(".class")) {
          logger.debug("Considering package of entry '{}'", name);
View Full Code Here

        this.bsn = deriveBundleSymbolicName();
        this.version = deriveBundleVersion();
        this.name = mainAttributes.getValue(Constants.BUNDLE_NAME);

        int count = 0;
        for (Enumeration e = bundle.entries(); e.hasMoreElements();) {
          ZipEntry entry = (ZipEntry) e.nextElement();

          if (entry.getName().startsWith(SRC_PREFIX)) {
            count++;
          }
View Full Code Here

     * @throws IOException
     */
    public List extractSources(File destDir) throws IOException {
      final List res = new ArrayList();
      final JarFile jarFile = new JarFile(file);
      for (Enumeration e = jarFile.entries(); e.hasMoreElements();) {
        ZipEntry entry = (ZipEntry) e.nextElement();

        if (entry.getName().startsWith(SRC_PREFIX)) {
          if (0 == res.size()) {
            destDir.mkdirs();
View Full Code Here

                JarURLConnection conn = (JarURLConnection) url.openConnection();

                JarFile jar = conn.getJarFile();

                Enumeration<JarEntry> en = jar.entries();

                while (en.hasMoreElements()) {
                    JarEntry jarEntry = en.nextElement();

                    String classname = jarEntry.getName();
View Full Code Here

      } else {

        inJar = new JarFile(inFile);
        try {
          addManifest(inJar.getManifest());
          Enumeration entries = inJar.entries();

          while (entries.hasMoreElements()) {
            JarEntry entry = (JarEntry) entries.nextElement();
            InputStream inStream = inJar.getInputStream(entry);
View Full Code Here

        log.debugf"Scan resources in JarFile( %s ) by regex( %s ) base on src ( %s )",
              jarPath,
              regex,
              src);
      JarFile jar = new JarFile(jarPath);
      Enumeration<JarEntry> ens = jar.entries();
      while (ens.hasMoreElements()) {
        JarEntry jen = ens.nextElement();
        if (jen.isDirectory())
          continue;
        String name = jen.getName();
View Full Code Here

                            }
                        }
                    } else {
                        try {
                            List<JarEntry> dirp = new ArrayList<JarEntry>();
                            for(Enumeration<JarEntry> eje = jf.entries(); eje.hasMoreElements(); ) {
                                JarEntry je = eje.nextElement();
                                String name = je.getName();
                                int ix = name.indexOf('/', jar.length());
                                if((!name.startsWith("META-INF") && (ix == -1 || ix == name.length()-1))) {
                                    if("/".equals(jar) || (name.startsWith(jar) && name.length()>jar.length())) {
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.