Package java.util.jar

Examples of java.util.jar.JarOutputStream.closeEntry()


               while( bytes > 0 )
               {
                  jos.write(buffer, 0, bytes);
                  bytes = is.read(buffer);
               }
               jos.closeEntry();
            }
            jarFile.close();
            jos.close();
            tmpFile.delete();
         }
View Full Code Here


      int read;
      while ((read = jarIn.read(buffer)) != -1) {
        jarOut.write(buffer, 0, read);
      }
     
      jarOut.closeEntry();
    }
   
    // Flush and close all the streams
    jarOut.flush();
    jarOut.close();
View Full Code Here

                        InputStream in = input.getInputStream(entry);
                        while ((count = in.read(buf)) > -1) {
                            out.write(buf, 0, count);
                        }
                        in.close();
                        out.closeEntry();
                    }
                }
                out.flush();
                out.close();
                input.close();
View Full Code Here

            if (manifest != null) {
                out = new JarOutputStream(new FileOutputStream(destinationFile), manifest);

                // add the startup file which allows us to locate the startup directory
                out.putNextEntry(new ZipEntry("META-INF/startup-jar"));
                out.closeEntry();
            } else {
                out = new JarOutputStream(new FileOutputStream(destinationFile));
            }

            // write the configurationData
View Full Code Here

                        int count;
                        while ((count = in.read(buffer)) > 0) {
                            out.write(buffer, 0, count);
                        }
                    } finally {
                        out.closeEntry();
                    }
                } finally {
                    close(in);
                }
            }
View Full Code Here

            JarOutputStream jos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(sourceFile)));
            jos.putNextEntry(new ZipEntry("META-INF/config.ser"));
            ObjectOutputStream oos = new ObjectOutputStream(jos);
            gbean.writeExternal(oos);
            oos.flush();
            jos.closeEntry();
            jos.close();
        } catch (Exception e) {
            if (sourceFile != null) {
                sourceFile.delete();
            }
View Full Code Here

                            int count;
                            while ((count = in.read(buffer)) > 0) {
                                out.write(buffer, 0, count);
                            }
                        } finally {
                            out.closeEntry();
                        }
                    } finally {
                        close(in);
                    }
                }
View Full Code Here

                entryOut.setComment(entryIn.getComment());
                jos.putNextEntry(entryOut);
                if (!entryIn.isDirectory()) {
                    IOUtils.copy(jis, jos);
                }
                jos.closeEntry();
                jis.closeEntry();
                entryIn = jis.getNextJarEntry();
            }

            // close the JAR file now to force writing
View Full Code Here

            zos.setLevel(Deflater.NO_COMPRESSION);
            // manifest first
            final ZipEntry anEntry = new ZipEntry(JarFile.MANIFEST_NAME);
            zos.putNextEntry(anEntry);
            mf.write(zos);
            zos.closeEntry();
            zipDir(sourceDir, zos, "");
        } finally {
            try {
                zos.close();
            } catch ( final IOException ignore ) {
View Full Code Here

                entryOut.setComment(entryIn.getComment());
                jos.putNextEntry(entryOut);
                if (!entryIn.isDirectory()) {
                    spool(jis, jos);
                }
                jos.closeEntry();
                jis.closeEntry();
                entryIn = jis.getNextJarEntry();
            }

            // close the JAR file now to force writing
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.