Package java.util.zip

Examples of java.util.zip.ZipFile.entries()


  public static void unZip(File inFile, File unzipDir) throws IOException {
    Enumeration entries;
    ZipFile zipFile = new ZipFile(inFile);

    try {
      entries = zipFile.entries();
      while (entries.hasMoreElements()) {
        ZipEntry entry = (ZipEntry) entries.nextElement();
        if (!entry.isDirectory()) {
          InputStream in = zipFile.getInputStream(entry);
          try {
View Full Code Here


  private List<IFile> listFiles(boolean includeFilesInNestedSubdirs)
  {
    List<IFile> files = new ArrayList<IFile>();

    ZipFile z = openZipFile();
    List<? extends ZipEntry> entries = Collections.list(z.entries());

    for (ZipEntry possibleEntry : entries) {
      if (isInDir(getNameInZip(), possibleEntry, includeFilesInNestedSubdirs)) {
        ZipDirectory parent = includeFilesInNestedSubdirs ? buildParent(possibleEntry) : this;
        if (possibleEntry.isDirectory()) {
View Full Code Here

     
        List bytecodes = new ArrayList();     
     
        // Iterate through all entries in the jar file to find the
        // translet and auxiliary classes.
        Enumeration entries = jarFile.entries();
        while (entries.hasMoreElements())
        {
            ZipEntry entry = (ZipEntry)entries.nextElement();
            String entryName = entry.getName();
            if (entry.getSize() > 0 &&
View Full Code Here

   */
  private static void updateMap(String jar, Map<String, String> packagedClasses) throws IOException {
    ZipFile zip = null;
    try {
      zip = new ZipFile(jar);
      for (Enumeration<? extends ZipEntry> iter = zip.entries(); iter.hasMoreElements();) {
        ZipEntry entry = iter.nextElement();
        if (entry.getName().endsWith("class")) {
          packagedClasses.put(entry.getName(), jar);
        }
      }
View Full Code Here

            findClassesInPathsDir(strPath, file, listClasses);
        }
        else if (file.exists())
        {
            zipFile = new ZipFile(file);
            entries = zipFile.entries();
            while (entries.hasMoreElements())
            {
                strEntry = entries.nextElement().toString();
                if (strEntry.endsWith(".class"))
                {
View Full Code Here

    public static Map<String, byte[]> indexZipFile(java.io.File jarFile) {
        Map<String, byte[]> files = new HashMap<String, byte[]>();
        ZipFile zipFile = null;
        try {
            zipFile = new ZipFile( jarFile );
            Enumeration< ? extends ZipEntry> entries = zipFile.entries();
            while ( entries.hasMoreElements() ) {
                ZipEntry entry = entries.nextElement();
                byte[] bytes = readBytesFromInputStream( zipFile.getInputStream( entry ) );
                files.put( entry.getName(),
                           bytes );
View Full Code Here

    public static Map<String, ZipEntry> buildZipFileMapEntries(java.io.File jarFile) {
        Map<String, ZipEntry> files = new HashMap<String, ZipEntry>();
        ZipFile zipFile = null;
        try {
            zipFile = new ZipFile( jarFile );
            Enumeration< ? extends ZipEntry> entries = zipFile.entries();
            while ( entries.hasMoreElements() ) {
                ZipEntry entry = entries.nextElement();
                files.put( entry.getName(),
                           entry );
            }
View Full Code Here

                final URL captchaURL = SoloServletListener.class.getClassLoader().getResource("captcha_static.zip");

                zipFile = new ZipFile(captchaURL.getFile());
            }

            final Enumeration<? extends ZipEntry> entries = zipFile.entries();

            int i = 0;

            while (entries.hasMoreElements()) {
                final ZipEntry entry = entries.nextElement();
View Full Code Here

         boolean exsitNativeFile = false;
         Connector connector = null;

         ArrayList<String> names = new ArrayList<String>();
         ArrayList<String> xmls = new ArrayList<String>();
         Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();

         while (zipEntries.hasMoreElements())
         {
            ZipEntry ze = (ZipEntry) zipEntries.nextElement();
            String name = ze.getName();
View Full Code Here

     
        List bytecodes = new ArrayList();     
     
        // Iterate through all entries in the jar file to find the
        // translet and auxiliary classes.
        Enumeration entries = jarFile.entries();
        while (entries.hasMoreElements())
        {
            ZipEntry entry = (ZipEntry)entries.nextElement();
            String entryName = entry.getName();
            if (entry.getSize() > 0 &&
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.