JarEntry: isDirectory() : JarEntry « java.util.jar « Java by API






JarEntry: isDirectory()

  
import java.io.IOException;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

public class Main {

  public static void main(String[] args) throws IOException {

    JarFile jf = new JarFile(args[0]);
    Enumeration e = jf.entries();
    while (e.hasMoreElements()) {
      JarEntry je = (JarEntry) e.nextElement();
      String name = je.getName();

      long crc = je.getCrc();
      System.out.println("Its CRC is " + crc);
      String comment = je.getComment();
      if (comment != null && !comment.equals("")) {
        System.out.println(comment);
      }
      if (je.isDirectory()) {
        System.out.println(name + " is a directory");
      }

    }
  }
}

   
    
  








Related examples in the same category

1.JarEntry: getAttributes()
2.JarEntry: getCompressedSize()
3.JarEntry: getComment()
4.JarEntry: getCrc()
5.JarEntry: getName()
6.JarEntry: getSize()
7.JarEntry: getTime()
8.JarEntry: setTime(long time)