import java.net.*; import java.io.*; import java.util.*; public class updatePackages implements Runnable { String serverURL; String classURL; String classPath; String server; LoadModule lm; String packageName; public updatePackages(String server, String serverURL, String classPath, LoadModule lm) { this.server = server; this.serverURL = serverURL; this.lm = lm; this.classPath = classPath; classURL = serverURL+classPath; } public void setPackageName(String s) { packageName = s; } public void run() { lm.setPackageName("loading package "+packageName); makeNewDirectory(server); StringTokenizer st = new StringTokenizer(packageName,"."); String s0 = st.nextToken(); String dirName = server+File.separator+s0; classURL += "/"+s0; makeNewDirectory(dirName); while(st.hasMoreTokens()) { String s = st.nextToken(); dirName += File.separator+s; classURL += "/"+s; makeNewDirectory(dirName); } String[] packageClasses = makeListOfClasses(classURL); lm.setPBmaximum(packageClasses.length); for(int i = 0; i-1) { int idx = nextLine.indexOf("href="); if(idx>-1) { String x = nextLine.substring(idx+6); int idx2 = x.indexOf(">"); x=x.substring(idx2+1); int idx1 = x.indexOf("<"); x=x.substring(0,idx1); System.out.println(x); c.addElement(x); } } /* jigsaw if(nextLine.startsWith("")){ StringTokenizer st = new StringTokenizer(nextLine,"="); while(st.hasMoreTokens()) { String x = st.nextToken(); if(x.indexOf(".class") > -1) { x = x.substring(x.indexOf(".class\">")+8); x = x.substring(0, x.indexOf("<")); c.addElement(x); } } } */ } } catch (Exception e) {System.out.println(e+" while makeListOfClasses");} String[] result = new String[c.size()]; for (int i=0; i