From 53929b5dfe484377be596b99f568880cac5f73db Mon Sep 17 00:00:00 2001 From: VegOwOtenks Date: Sat, 2 Nov 2024 09:53:43 +0100 Subject: [PATCH] Script for extracting .classes --- scripts/ClassPath.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/ClassPath.java diff --git a/scripts/ClassPath.java b/scripts/ClassPath.java new file mode 100644 index 0000000..88129a8 --- /dev/null +++ b/scripts/ClassPath.java @@ -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); + } +}