Package sun.tools.jar

Examples of sun.tools.jar.Main.run()


        dirInner.setLastModified(yesterday);
        fileInner.setLastModified(earlier);

        // Make a jar file from that directory structure
        Main jartool = new Main(System.out, System.err, "jar");
        check(jartool.run(new String[] {
                "cf",
                jarFile.getName(), dirOuter.getName() } ));
        check(jarFile.exists());

        check(cleanup(dirInner));
View Full Code Here


            argList.add(fileName);
            String jarArgs[] = new String[argList.size()];
            jarArgs = argList.toArray(jarArgs);

            Main jarTool = new Main(System.out, System.err, "jar");
            if (!jarTool.run(jarArgs)) {
                fail("Could not create jar file.");
            }

            // Check that the entry for hello.txt does *not* have a pathname.
            jf = new JarFile(jarName);
View Full Code Here

        // Create a jar file, specifying a Main-Class
        final String jarFileName = "um-existence.jar";
        new File(jarFileName).delete(); // remove pre-existing first!
        Main jartool = new Main(out, err, "jar");
        boolean status = jartool.run(
            new String[] { "cfe", jarFileName, "Hello", existence.getPath() });
        check(status);
        checkManifest(jarFileName, "Hello");

        // Update that jar file by changing the Main-Class
View Full Code Here

        check(status);
        checkManifest(jarFileName, "Hello");

        // Update that jar file by changing the Main-Class
        jartool = new Main(out, err, "jar");
        status = jartool.run(
            new String[] { "ufe", jarFileName, "Bye" });
        check(status);
        checkManifest(jarFileName, "Bye");
    }
View Full Code Here

        // Create a jar file
        final String jarFileName = "um-test.jar";
        new File(jarFileName).delete(); // remove pre-existing first!
        Main jartool = new Main(out, err, "jar");
        boolean status = jartool.run(
                                new String[] {"cfm", jarFileName,
                                    manifestOrig.getPath(), hello.getPath() });
        check(status);

        // Create a new manifest, to use in updating the jar file.
View Full Code Here

        pw.println(specVersion); // addition to animal/marsupial section
        pw.close();

        // Update jar file with manifest
        jartool = new Main(out, err, "jar");
        status = jartool.run(
            new String[] { "ufm", jarFileName, manifestUpdate.getPath() });
        check(status);

        // Extract jar, and verify contents of manifest file
        File f = new File(jarFileName);
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.