diff --git a/src/chatprogramm/Start.java b/src/chatprogramm/Start.java index 8a5ff57..a38a647 100644 --- a/src/chatprogramm/Start.java +++ b/src/chatprogramm/Start.java @@ -6,42 +6,14 @@ package chatprogramm; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; - /** * Builder Class * @author le */ public class Start { - public Start(String urlString, String dateiname) throws MalformedURLException, IOException + public Start() { - URL oUrl = new URL(urlString + "/" + dateiname); - InputStream iStream = oUrl.openStream(); - BufferedInputStream in = new BufferedInputStream(iStream); - - String tmpVerzeichnis = System.getProperty("java.io.tmpdir"); - String ausgabeDateiname = tmpVerzeichnis + File.separator + dateiname; - - FileOutputStream fos = new FileOutputStream(ausgabeDateiname); - BufferedOutputStream out = new BufferedOutputStream(fos); - - int wert = 0; - - while ( (wert = in.read()) >= 0) - { - out.write(wert); - } - in.close(); - out.close(); // flush! - System.out.println("Datei " + ausgabeDateiname + " erfolgreich erstellt"); } @@ -50,21 +22,6 @@ public class Start */ public static void main(String[] args) { - if (args.length != 2) - { - System.err.println("2 Aufrufparameter nötig: URL-String Dateiname"); - } - else - { - try - { - new Start(args[0], args[1]); - } - catch (Exception ex) - { - System.err.println(ex); - ex.printStackTrace(); - } - } + new Start(); } }