Package java.util.jar

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


          while (c > -1) {
            target.write(buffer, 0, c);
            c = stream.read(buffer);
          }
        }
        target.closeEntry();

      }
     
      if(mainClazz != null) {
        String name = mainClazz.getName();
View Full Code Here


          while (c > -1) {
            target.write(buffer, 0, c);
            c = stream.read(buffer);
          }
        }
        target.closeEntry();
      }

      target.close();
    }
View Full Code Here

                  byte[] buffer = new byte[255];
                  for (int len; (len = classStream.read(buffer)) != -1;)
                  {
                     jarOutput.write(buffer, 0, len);
                  }
                  jarOutput.closeEntry();

                  // close the JAR archive and return the InputStream
                  jarOutput.close();
                  return new ByteArrayInputStream(byteArrayStream.toByteArray());
View Full Code Here

        JarOutputStream out = new JarOutputStream(os);
        ZipEntry e = new ZipEntry(JarFile.MANIFEST_NAME);
        out.putNextEntry(e);
        m.write(out);
        out.closeEntry();
        e = new ZipEntry("OSGI-INF/");
        out.putNextEntry(e);
        e = new ZipEntry("OSGI-INF/blueprint/");
        out.putNextEntry(e);
        out.closeEntry();
View Full Code Here

        out.closeEntry();
        e = new ZipEntry("OSGI-INF/");
        out.putNextEntry(e);
        e = new ZipEntry("OSGI-INF/blueprint/");
        out.putNextEntry(e);
        out.closeEntry();
        // check .xml file extension
        if( !name.endsWith(".xml")) {
            name +=".xml";
        }
        e = new ZipEntry("OSGI-INF/blueprint/" + name);
View Full Code Here

        // Copy the new DOM
        if (tf == null) {
            tf = TransformerFactory.newInstance();
        }
        tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
        out.closeEntry();
        out.close();
    }

    public static Set<String> analyze(Source source) throws Exception {
        if (transformer == null) {
View Full Code Here

                for (int i = is.read(buffer); i != -1; i = is.read(buffer))
                {
                    os.write(buffer, 0, i);
                }
                is.close();
                os.closeEntry();
            }
            os.close();
            return f;
        }
View Full Code Here

            for (int i = is.read(buffer); i != -1; i = is.read(buffer))
            {
                os.write(buffer, 0, i);
            }
            is.close();
            os.closeEntry();
        }
        os.close();
        return f;
    }
View Full Code Here

        if (includeIndex)
        {
            // Write the INDEX.LIST file as first entry...
            jos.putNextEntry(new ZipEntry(INDEX_NAME));
            jos.write(("JarIndex-Version: 1.0\n\n" + m_jarFile.getName() + "\n").getBytes());
            jos.closeEntry();

            if (man != null)
            {
                jos.putNextEntry(new ZipEntry(MANIFEST_NAME));
                man.write(jos);
View Full Code Here

            if (man != null)
            {
                jos.putNextEntry(new ZipEntry(MANIFEST_NAME));
                man.write(jos);
                jos.closeEntry();
            }
        }

        try
        {
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.