Unpacking a jar file using pack200
I am trying to unpack a jar file using pack200 but cannot figure out what i am suppose to have in the input stream.
Code:
import java.io.*;
import java.util.jar.*;
public class test {
public static void main(String args[]) throws IOException{
String userName = System.getProperty("user.home");
File outName = new File(userName +"/Desktop/test.jar");
File inName = new File(userName + "/Desktop/tmp");
Pack200.Unpacker unpacker = Pack200.newUnpacker();
JarOutputStream out = new JarOutputStream(new FileOutputStream(outName));
InputStream in = new FileInputStream(inName);
unpacker.unpack(in, out);
out.close();
}
}
Code:
Exception in thread "main" java.io.FileNotFoundException: /home/***/Desktop/tmp (Is a directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at test.main(test.java:10)
I know from previous experiences that (Is a directory) means that the path needs to be something other than a directory but what does the path need to be for the pack200 to work?