Package java.util.zip

Examples of java.util.zip.ZipEntry


      sig.initVerify( key );
     
      while( true ){
       
        ZipEntry  entry = zis.getNextEntry();
         
        if ( entry == null ){
         
          break;
        }
     
        if ( entry.isDirectory()){
         
          continue;
        }
       
        String  name = entry.getName();
     
        ByteArrayOutputStream  output = null;
       
        if ( name.equalsIgnoreCase("azureus.sig")){
         
View Full Code Here


     
      UpdateInstaller installer = checker.createInstaller();

      zip = new ZipInputStream(data);

      ZipEntry entry = null;

      while ((entry = zip.getNextEntry()) != null) {

        String name = entry.getName();

        if (name.toLowerCase().startsWith("osx/")) {

          // OSX only files
View Full Code Here

          fin = new FileInputStream(filtersFile);
          bin = new BufferedInputStream(fin, 16384);
        } else if (headerBytes[0] == 0x50 && headerBytes[1] == 0x4b) {
          ZipInputStream zip = new ZipInputStream(bin);

          ZipEntry zipEntry = zip.getNextEntry();
          // Skip small files
          while (zipEntry != null && zipEntry.getSize() < 1024 * 1024) {
            zipEntry = zip.getNextEntry();
          }

          if (zipEntry == null) {
            return;
View Full Code Here

                return true;
            }
            ZipInputStream file = openZip(fileName);
            boolean result = false;
            while (true) {
                ZipEntry entry = file.getNextEntry();
                if (entry == null) {
                    break;
                }
                if (entry.getName().equals(entryName)) {
                    result = true;
                    break;
                }
                file.closeEntry();
            }
View Full Code Here

                return true;
            }
            ZipInputStream file = openZip(fileName);
            boolean result = false;
            while (true) {
                ZipEntry entry = file.getNextEntry();
                if (entry == null) {
                    break;
                }
                String n = entry.getName();
                if (n.equals(entryName)) {
                    result = entry.isDirectory();
                    break;
                } else  if (n.startsWith(entryName)) {
                    if (n.length() == entryName.length() + 1) {
                        if (n.equals(entryName + "/")) {
                            result = true;
View Full Code Here

        try {
            String entryName = getEntryName(fileName);
            ZipInputStream file = openZip(fileName);
            long result = 0;
            while (true) {
                ZipEntry entry = file.getNextEntry();
                if (entry == null) {
                    break;
                }
                if (entry.getName().equals(entryName)) {
                    result = entry.getSize();
                    if (result == -1) {
                        result = 0;
                        while (true) {
                            long x = file.skip(16 * Constants.IO_BUFFER_SIZE);
                            if (x == 0) {
View Full Code Here

            ZipInputStream file = openZip(path);
            String dirName = getEntryName(path);
            String prefix = path.substring(0, path.length() - dirName.length());
            ArrayList<String> list = New.arrayList();
            while (true) {
                ZipEntry entry = file.getNextEntry();
                if (entry == null) {
                    break;
                }
                String name = entry.getName();
                if (name.startsWith(dirName) && name.length() > dirName.length()) {
                    int idx = name.indexOf('/', dirName.length());
                    if (idx < 0 || idx >= name.length() - 1) {
                        list.add(prefix + name);
                    }
View Full Code Here

        if (entryName.length() == 0) {
            throw new FileNotFoundException(fileName);
        }
        ZipInputStream in = openZip(fileName);
        while (true) {
            ZipEntry entry = in.getNextEntry();
            if (entry == null) {
                break;
            }
            if (entry.getName().equals(entryName)) {
                return new FileObjectZip2(fileName, entryName, in, length(fileName));
            }
            in.closeEntry();
        }
        in.close();
View Full Code Here

            zipOut.setLevel(Deflater.BEST_COMPRESSION);
            for (File file : files) {
                String fileName = file.getPath();
                String entryName = removeBase(basePath, fileName);
                byte[] data = readFile(file);
                ZipEntry entry = new ZipEntry(entryName);
                CRC32 crc = new CRC32();
                crc.update(data);
                entry.setSize(file.length());
                entry.setCrc(crc.getValue());
                zipOut.putNextEntry(entry);
                zipOut.write(data);
                zipOut.closeEntry();
            }
            zipOut.closeEntry();
View Full Code Here

                if (IOUtils.isDirectory(fileName)) {
                    continue;
                }
                f = f.substring(base.length());
                f = BackupCommand.correctFileName(f);
                ZipEntry entry = new ZipEntry(f);
                zipOut.putNextEntry(entry);
                InputStream in = null;
                try {
                    in = IOUtils.openFileInputStream(fileName);
                    IOUtils.copyAndCloseInput(in, zipOut);
View Full Code Here

TOP

Related Classes of java.util.zip.ZipEntry

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.