Java Code Examples for java.util.jar.Pack200#Unpacker

The following examples show how to use java.util.jar.Pack200#Unpacker . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Utils.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 2
Source File: Utils.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 3
Source File: Utils.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 4
Source File: Utils.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 5
Source File: Utils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 6
Source File: Utils.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 7
Source File: Utils.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 8
Source File: Utils.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 9
Source File: Utils.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 10
Source File: Utils.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 11
Source File: Utils.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 12
Source File: Utils.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 13
Source File: Utils.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void unpack0(File inFile, JarOutputStream jarStream,
        boolean useJavaUnpack) throws IOException {
    // Unpack the files
    Pack200.Unpacker unpacker = Pack200.newUnpacker();
    Map<String, String> props = unpacker.properties();
    if (useJavaUnpack) {
        props.put("com.sun.java.util.jar.pack.disable.native", "true");
    }
    // Call the unpacker
    unpacker.unpack(inFile, jarStream);
}
 
Example 14
Source File: Startup.java    From Spark with Apache License 2.0 4 votes vote down vote up
/**
 * Converts any pack files in a directory into standard JAR files. Each
 * pack file will be deleted after being converted to a JAR. If no
 * pack files are found, this method does nothing.
 *
 * @param libDir      the directory containing pack files.
 * @param printStatus true if status ellipses should be printed when unpacking.
 */
private void unpackArchives(File libDir, boolean printStatus) {
    // Get a list of all packed files in the lib directory.
    File[] packedFiles = libDir.listFiles( ( dir, name ) -> {
        return name.endsWith(".pack");
    } );

    if (packedFiles == null) {
        // Do nothing since no .pack files were found
        return;
    }

    // Unpack each.
    boolean unpacked = false;
    for (File packedFile : packedFiles) {
        try {
            String jarName = packedFile.getName().substring(0,
                packedFile.getName().length() - ".pack".length());
            // Delete JAR file with same name if it exists (could be due to upgrade
            // from old Wildfire release).
            File jarFile = new File(libDir, jarName);
            if (jarFile.exists()) {
                jarFile.delete();
            }

            InputStream in = new BufferedInputStream(new FileInputStream(packedFile));
            JarOutputStream out = new JarOutputStream(new BufferedOutputStream(
                new FileOutputStream(new File(libDir, jarName))));
            Pack200.Unpacker unpacker = Pack200.newUnpacker();
            // Print something so the user knows something is happening.
            if (printStatus) {
                System.out.print(".");
            }
            // Call the unpacker
            unpacker.unpack(in, out);

            in.close();
            out.close();
            packedFile.delete();
            unpacked = true;
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
    // Print newline if unpacking happened.
    if (unpacked && printStatus) {
        System.out.println();
    }
}