diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/org/nwapw/abacus/Abacus.java b/src/org/nwapw/abacus/Abacus.java
index 08f4ba5..0522874 100644
--- a/src/org/nwapw/abacus/Abacus.java
+++ b/src/org/nwapw/abacus/Abacus.java
@@ -1,10 +1,14 @@
package org.nwapw.abacus;
import org.nwapw.abacus.plugin.PluginManager;
-import org.nwapw.abacus.plugin.StandardPlugin;
+//import org.nwapw.abacus.plugin.StandardPlugin;
import org.nwapw.abacus.window.Window;
+import org.nwapw.abacus.plugin.ClassFinderV2;
import javax.swing.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
public class Abacus {
@@ -22,10 +26,33 @@ public class Abacus {
e.printStackTrace();
}
manager = new PluginManager();
- manager.addInstantiated(new StandardPlugin(manager));
+ ArrayList names = new ArrayList();
+ try {
+
+ ClassFinderV2 classFinder = new ClassFinderV2();
+ File pluginFile = new File("C:\\Users\\galbraithja\\Desktop\\.git\\abacus\\src\\org\\nwapw\\abacus\\plugin");
+ for(File classes:pluginFile.listFiles()){
+ if(classes.getName().endsWith(".jar")){
+ names.addAll(classFinder.addJar("C:\\Users\\galbraithja\\Desktop\\.git\\abacus\\src\\org\\nwapw\\abacus\\plugin\\Standard.jar"));
+ }
+ }
+ for(String name:names){
+ System.out.println(name);
+ }
+ ArrayList classes = classFinder.getClasses();
+ for(Class classGet:classes){
+ manager.addClass(classGet);
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
mainUi = new Window(manager);
mainUi.setVisible(true);
manager.load();
+
}
public static void main(String[] args){
diff --git a/src/org/nwapw/abacus/plugin/ClassFinderV2.java b/src/org/nwapw/abacus/plugin/ClassFinderV2.java
new file mode 100644
index 0000000..3cdba13
--- /dev/null
+++ b/src/org/nwapw/abacus/plugin/ClassFinderV2.java
@@ -0,0 +1,51 @@
+package org.nwapw.abacus.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+public class ClassFinderV2 {
+ ArrayList classes;
+ URL[] urls;
+ public ClassFinderV2(){
+ classes = new ArrayList();
+ }
+ public ArrayList addJar(String path) throws IOException, ClassNotFoundException {
+ //urls = new URL[]{new URL("jar:file:" + path + "!/")};
+ return addJar(new File(path));
+ }
+ public ArrayList addJar(File jarLocation) throws IOException, ClassNotFoundException {
+ String path = jarLocation.getPath();
+ urls = new URL[]{new URL("jar:file:" + path + "!/")};
+ URLClassLoader classLoader = URLClassLoader.newInstance(urls);
+ JarFile jarFolder = new JarFile(jarLocation);
+ Enumeration jarList = jarFolder.entries();
+ ArrayList classNames = new ArrayList();
+ while(jarList.hasMoreElements()){
+ JarEntry tempJar = (JarEntry)jarList.nextElement();
+ if(tempJar.getName().endsWith(".class")){
+ //System.out.println(tempJar.getName());
+ classNames.add(tempJar.getName());
+ classes.add(classLoader.loadClass(tempJar.getName().replace('/','.').substring(0,tempJar.getName().length()-6)));
+ }
+ }
+ return classNames;
+ }
+ public ArrayList getClasses(){
+ return classes;
+ }
+ public Class getClass(int number){
+ return classes.get(number);
+ }
+ public void delClasses(){
+ classes=new ArrayList();
+ }
+ public int classCount(){
+ return classes.size();
+ }
+}
diff --git a/src/org/nwapw/abacus/plugin/Standard.jar b/src/org/nwapw/abacus/plugin/Standard.jar
new file mode 100644
index 0000000..723c411
Binary files /dev/null and b/src/org/nwapw/abacus/plugin/Standard.jar differ