Code example for JarEntry

0
    private static File createJarFile() throws IOException {
        File jarFile = File.createTempFile("JarBackSlashTest", ".jar");
        jarFile.deleteOnExit();
 
        try (JarOutputStream output = new JarOutputStream(new FileOutputStream(jarFile))) {
            JarEntry entry = new JarEntry(JARBACKSLASH + "/" + DIR + "/" + FILENAME);
            output.putNextEntry(entry);
        } 
 
        return jarFile;
    } 
 
    private static void testJarList(String jarFile) throws IOException {
        List<String> argList = new ArrayList<String>();
        argList.add("-tvf");
        argList.add(jarFile);
        argList.add(JARBACKSLASH + File.separatorChar + DIR + File.separatorChar + FILENAME);
 
        String jarArgs[] = new String[argList.size()];
        jarArgs = argList.toArray(jarArgs);
Connect your IDE to all the code out there  Get Codota for Java