url源码获取类

class urllprocess {  //url源码获取类


public ArrayList<String> urlprocess(String url) throws Exception {


URL oracle = new URL(url);
BufferedReader in = new BufferedReader(new InputStreamReader(
oracle.openStream()));


String inputLine;
ArrayList<String> man = new ArrayList<String>();
while ((inputLine = in.readLine()) != null) {
man.add(inputLine);
}
// man.remove(0);


return man;
}


// #pointer
public String[][] ReArray(String url) {
String[][] resultsa;
StringToArray sta = new StringToArray("\t");


try {
ArrayList<String> newurllist = urlprocess(url);
resultsa = new String[newurllist.size()][];
for (int i = 0; i < newurllist.size(); i++) {
resultsa[i] = sta.str2array((String) newurllist.get(i));
resultsa[i] = Arrays.copyOf(resultsa[i], resultsa[i].length);


// results[i][results.length-2]=process.getcode();
// results[i][results.length-1]=process.gettime();
}
// System.out.println(Arrays.deepToString(results));
return resultsa;
} catch (Exception e) {
// TODO: handle exception
}
return null;


}
}

你可能感兴趣的:(url源码获取类)