Package java.util.jar

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


                attrs.putValue("Bundle-Localization", "locale");
                JarOutputStream jos = new JarOutputStream(baos, manifest);
                jos.putNextEntry(new ZipEntry("locale_nl.properties"));
                String content = "bundleName=De koelste Bundle";
                jos.write(content.getBytes(), 0, content.getBytes().length);
                jos.closeEntry();
                jos.close();
                return new ByteArrayInputStream(baos.toByteArray());
            }

            @Override
View Full Code Here


                attrs.putValue("Bundle-Localization", "locale");
                JarOutputStream jos = new JarOutputStream(baos, manifest);
                jos.putNextEntry(new ZipEntry("locale.properties"));
                String content = "bundleName=De koelste Bundle";
                jos.write(content.getBytes(), 0, content.getBytes().length);
                jos.closeEntry();
                jos.putNextEntry(new ZipEntry("locale_" + Locale.ENGLISH + ".properties"));
                String contentEN = "bundleName=A damn fine Bundle";
                jos.write(contentEN.getBytes(), 0, contentEN.getBytes().length);
                jos.closeEntry();
                jos.putNextEntry(new ZipEntry("locale_" + Locale.US + ".properties"));
View Full Code Here

                jos.write(content.getBytes(), 0, content.getBytes().length);
                jos.closeEntry();
                jos.putNextEntry(new ZipEntry("locale_" + Locale.ENGLISH + ".properties"));
                String contentEN = "bundleName=A damn fine Bundle";
                jos.write(contentEN.getBytes(), 0, contentEN.getBytes().length);
                jos.closeEntry();
                jos.putNextEntry(new ZipEntry("locale_" + Locale.US + ".properties"));
                String contentUS = "bundleName=The Coolest Bundle";
                jos.write(contentUS.getBytes(), 0, contentUS.getBytes().length);
                jos.closeEntry();
View Full Code Here

                jos.write(contentEN.getBytes(), 0, contentEN.getBytes().length);
                jos.closeEntry();
                jos.putNextEntry(new ZipEntry("locale_" + Locale.US + ".properties"));
                String contentUS = "bundleName=The Coolest Bundle";
                jos.write(contentUS.getBytes(), 0, contentUS.getBytes().length);
                jos.closeEntry();

                jos.close();
                return new ByteArrayInputStream(baos.toByteArray());
            }
View Full Code Here

  byte[] ba;

  // write the META-INF directory entry, probably not really necessary
  entry = new JarEntry("META-INF/");
  jo.putNextEntry(entry);
  jo.closeEntry();

  // copy the original manifest entry to the new file
  entry = new JarEntry("META-INF/MANIFEST.MF");
  jo.putNextEntry(entry);
  ji.getManifest().write(jo);
View Full Code Here

  // copy the original manifest entry to the new file
  entry = new JarEntry("META-INF/MANIFEST.MF");
  jo.putNextEntry(entry);
  ji.getManifest().write(jo);
  jo.closeEntry();

  // write the new preferred list entry to the new file
  entry = new JarEntry("META-INF/PREFERRED.LIST");
  jo.putNextEntry(entry);
  ba = preferredList.getBytes();
View Full Code Here

      ba = new byte[1000];
      int size;
      while ((size = ji.read(ba, 0, 1000)) >= 0) {
    jo.write(ba, 0, size);
      }
      jo.closeEntry();
  }
  ji.close();
  jo.close();

  // copy the new JAR file over the old one
View Full Code Here

            try {
                JarOutputStream jar = new JarOutputStream(new FileOutputStream(outFile));
                int idx = resource.indexOf('/');
                while (idx > 0) {
                    jar.putNextEntry(new ZipEntry(resource.substring(0, idx)));
                    jar.closeEntry();
                    idx = resource.indexOf('/', idx + 1);
                }
                jar.putNextEntry(new ZipEntry(resource));
                int c;
                while ((c = is.read()) >= 0) {
View Full Code Here

                jar.putNextEntry(new ZipEntry(resource));
                int c;
                while ((c = is.read()) >= 0) {
                    jar.write(c);
                }
                jar.closeEntry();
                jar.close();
            } finally {
                safeClose(is);
            }
        }
View Full Code Here

            try {
                JarOutputStream jar = new JarOutputStream(new FileOutputStream(outFile));
                int idx = resource.indexOf('/');
                while (idx > 0) {
                    jar.putNextEntry(new ZipEntry(resource.substring(0, idx)));
                    jar.closeEntry();
                    idx = resource.indexOf('/', idx + 1);
                }
                jar.putNextEntry(new ZipEntry(resource));
                int c;
                while ((c = is.read()) >= 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.