Package java.util.jar

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


    jstream.putNextEntry(ze);
    jstream.closeEntry();
    ze = new ZipEntry("lib/lib2.jar");
    jstream.putNextEntry(ze);
    jstream.closeEntry();
    jstream.finish();
    jstream.close();
    job.setJar(jobJarFile.toURI().toString());
  }

  /**
 
View Full Code Here


    jstream.putNextEntry(ze);
    jstream.closeEntry();
    ze = new ZipEntry("lib/lib2.jar");
    jstream.putNextEntry(ze);
    jstream.closeEntry();
    jstream.finish();
    jstream.close();
    jobConf.setJar(jobJarFile.toURI().toString());
  }

  /**
 
View Full Code Here

        jos.closeEntry();
        // Put su artifact
        for (int i = 0; i < suName.length; i++) {
            jos.putNextEntry(new ZipEntry(suName[i] + ".zip"));
            JarOutputStream jos2 = new JarOutputStream(jos, new Manifest());
            jos2.finish();
            jos2.flush();
            jos.closeEntry();
        }
        // Close jar
        jos.close();
View Full Code Here

    jstream.putNextEntry(ze);
    jstream.closeEntry();
    ze = new ZipEntry("lib/lib2.jar");
    jstream.putNextEntry(ze);
    jstream.closeEntry();
    jstream.finish();
    jstream.close();
    job.setJar(jobJarFile.toURI().toString());
  }

  /**
 
View Full Code Here

  public static InputStream unpack(final InputStream input)
      throws IOException {
    final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    final JarOutputStream jar = new JarOutputStream(buffer);
    Pack200.newUnpacker().unpack(new NoCloseInput(input), jar);
    jar.finish();
    return new ByteArrayInputStream(buffer.toByteArray());
  }

  /**
   * Packs a buffer in JAR/ZIP format into a stream in Pack200 format.
View Full Code Here

                        in.close();
                     }
                  }
               }
               jos.flush();
               jos.finish();
            }
            catch(IOException e)
            {
               // FIXME: How to handle this?
               log.warn(e.getMessage(), e);
View Full Code Here

            jarOut.write(e.getValue());
            jarOut.flush();
            jarOut.closeEntry();
        }

        jarOut.finish();
    }

    ///////////////////////////////////////////////////////
    // UTILITY
    ///////////////////////////////////////////////////////
View Full Code Here

                    jarOut.putNextEntry(entry);
                    jarOut.write(contents);
                    jarOut.closeEntry();
                }
            } finally {
                jarOut.finish();
                jarOut.flush();
                closeOutput(out);
            }
        } catch (Exception ex) {
            if (args.debug) {
View Full Code Here

        File file = File.createTempFile("testGetAttributes", "", new File(basedir + File.separator + "target"));
        Manifest m = new Manifest();
        m.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
        m.getMainAttributes().put(new Attributes.Name("Header"), "value");
        JarOutputStream jar = new JarOutputStream(new FileOutputStream(file), m);
        jar.finish();
        jar.close();

        Attributes attributes = this.builder.getAttributes("http://x", file);
        assertThat(attributes.getValue("Header").toString(), equalTo("value"));
        file.delete();
View Full Code Here

                            }
                        }
                    }
                }
                if (sharedResourceFile != null) {
                    out.finish();
                    out.close();
                    if (!bundleClassPath.contains(path)) {
                        embeddedResources.put(path, sharedResourceFile);
                        addBundleClassPath(path);
                        LOG.info("Adding shared resources jar: " + path);
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.