Hey !
hab'n problem .. vlt. könnt ihr mir helfen ..
ich will'n html- file von ner url - lesen und dann in ein .html- file speichern - der test-code bis jetz :
Code:
public void downloadSingle(String url){
try{
//erzeugt neues URL - objekt
URL u = new URL(url);
//file auf das geschrieben werden soll..
File f = new File("test.html");
//gibt verschiedene informationen über url aus:
gatherStuffAboutURLAndPrintItOut(u);
//öffnet stream
InputStream is = u.openStream();
// od. connection öffnen ??
URLConnection uc = u.openConnection();
//wie geht's weiter ??
}catch(Exception e){
e.printStackTrace(System.err);
}
}
büdde um hilfe, thx suso
(aja: es sollten keine externen api's wie die apache commons net od. so verwendet werden ... )
Lesezeichen