private byte[] loadClassData(String className) throws IOException { Playground.println("Loading class " + className + ".class", warning); File f = new File(System.getProperty("user.dir") + "/" + className + ".class"); byte[] b = new byte[(int) f.length()]; new FileInputStream(f).read(b); return b; }
public void loadGroups() { try { File groupFile = new File("groups.txt"); if (groupFile.exists()) { BufferedReader br = new BufferedReader(new FileReader("groups.txt")); List<String> groupStrings = new ArrayList<String>(); while (true) { String s = br.readLine(); if (s != null) { groupStrings.add(s); } else { break; } } for (String s : groupStrings) { String[] info = s.split(":"); Group g = new Group(info[0], info[2], GroupType.toGroupType(info[1])); if (!info[3].equals("null")) { g.street = info[3]; } if (!info[4].equals("null")) { g.playground = Playground.getPlayground(info[4]); } g.players = Integer.parseInt(info[5]); for (int i = 6; i < info.length; i++) { for (Modifier[] array : g.validModifiers) { for (Modifier m : array) { for (String s2 : m.searchText) { if (s2.equalsIgnoreCase(info[i])) { g.modifiers.add(m); break; } } } } } groups.add(g); } br.close(); groupFile.delete(); } } catch (IOException ex) { } }