Script for extracting .classes
This commit is contained in:
parent
3fd30b80b6
commit
53929b5dfe
1 changed files with 17 additions and 0 deletions
17
scripts/ClassPath.java
Normal file
17
scripts/ClassPath.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
import java.io.OutputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.Class;
|
||||
|
||||
public class ClassPath {
|
||||
|
||||
public static void main(String args[]) throws FileNotFoundException, IOException, ClassNotFoundException {
|
||||
String path = args[0];
|
||||
String basename = path.replaceAll("\\w+\\.", "");
|
||||
OutputStream o = new FileOutputStream(path.replace(".", "/") + ".class");
|
||||
Class.forName(args[0]).getResourceAsStream(basename + ".class")
|
||||
.transferTo(o);
|
||||
System.out.println(path);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue