Package java.util.zip

Examples of java.util.zip.ZipOutputStream.closeEntry()


      if (DebugFile.trace) DebugFile.writeln("Putting entry "+sLocalName+" into ZIP");
    oZOut.putNextEntry(new ZipEntry(sLocalName));
      StringBufferInputStream oHtml = new StringBufferInputStream(sHtml);
      new StreamPipe().between(oHtml, oZOut);
      oHtml.close();
      oZOut.closeEntry();

      for (String sName : oFiles) {
        String sZipEntryName = sName.substring(sName.replace('\\','/').lastIndexOf('/')+1);
        if (!oEntries.contains(sZipEntryName)) {
          oEntries.add(sZipEntryName);
View Full Code Here


          DebugFile.decIdent();
                DebugFile.writeln("Could not download file "+sBasePath+(sName.startsWith("/") ? sName.substring(1) : sName));
              }
            }       
          }
          oZOut.closeEntry();
        } // fi (sName!=sLocalName)
      } // next
      oZOut.close();

    } catch (MalformedPatternException mpe) {
View Full Code Here

            byte [] buffer = new byte [8096];
            int size;
            while ((size = tempIn.read(buffer)) != -1) {
              zipOut.write(buffer, 0, size);
            }
            zipOut.closeEntry();
          } finally {
            if (tempIn != null) {
              tempIn.close();
            }
          }         
View Full Code Here

    zipOut.putNextEntry(new ZipEntry("Home"));
    // Use an ObjectOutputStream that keeps track of Content objects
    ObjectOutputStream objectOut = new HomeObjectOutputStream(zipOut);
    objectOut.writeObject(home);
    objectOut.flush();
    zipOut.closeEntry();
    // Write Content objects in files "0" to "n"
    for (int i = 0, n = contents.size(); i < n; i++) {
      Content content = contents.get(i);
      String entryNameOrDirectory = String.valueOf(i);
      if (content instanceof ResourceURLContent) {
View Full Code Here

        os.write(buff, 0, r);

      is.close();

      os.flush();
      os.closeEntry();
      os.close();
    } catch (Throwable e) {
      Log.log(Log.WARNING, "lazyj.Utils", "compressToZip : cannot compress '" + sSource + "' to '" + sDest + "' because", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
      return false;
    } finally {
View Full Code Here

            XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bufferedOutputStream, "UTF-8");
            gephiWriter.writeAll(project, writer);
            writer.close();

            //Close
            zipOut.closeEntry();
            zipOut.finish();
            bufferedOutputStream.close();


View Full Code Here

        int len;
        byte[] buf = new byte[1024];
        while ((len = is.read(buf)) > 0) {
            zos.write(buf, 0, len);
        }
        zos.closeEntry();
        zos.close();
        URL url = new URL("jar:" + file.toURL() + "!/log4j.xml");
        DOMConfigurator.configure(url);
        assertTrue(file.delete());
        assertFalse(file.exists());
View Full Code Here

        File file = new File("output/properties.jar");
        ZipOutputStream zos =
            new ZipOutputStream(new FileOutputStream(file));
        zos.putNextEntry(new ZipEntry(LogManager.DEFAULT_CONFIGURATION_FILE));
        zos.write("log4j.rootLogger=debug".getBytes());
        zos.closeEntry();
        zos.close();
        URL url = new URL("jar:" + file.toURL() + "!/" +
                LogManager.DEFAULT_CONFIGURATION_FILE);
        PropertyConfigurator.configure(url);
        assertTrue(file.delete());
View Full Code Here

            for ( Connection connection : connections )
            {
                connectionParameters.add( connection.getConnectionParameter() );
            }
            ConnectionIO.save( connectionParameters, zos );
            zos.closeEntry();
            // Writing the Connection Folders file.
            zos.putNextEntry( new ZipEntry( Messages.getString( "ExportConnectionsWizard.2" ) ) ); //$NON-NLS-1$
            ConnectionFolder[] connectionFolders = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
                .getConnectionFolders();
            Set<ConnectionFolder> connectionFoldersSet = new HashSet<ConnectionFolder>();
View Full Code Here

            for ( ConnectionFolder connectionFolder : connectionFolders )
            {
                connectionFoldersSet.add( connectionFolder );
            }
            ConnectionIO.saveConnectionFolders( connectionFoldersSet, zos );
            zos.closeEntry();
            // Writing the Browser Connections file.
            zos.putNextEntry( new ZipEntry( Messages.getString( "ExportConnectionsWizard.3" ) ) ); //$NON-NLS-1$
            IBrowserConnection[] browserConnections = BrowserCorePlugin.getDefault().getConnectionManager()
                .getBrowserConnections();
            Map<String, IBrowserConnection> browserConnectionsMap = new HashMap<String, IBrowserConnection>();
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.