Say I have a url
www.hosting.com/words.bin
how would I read the words hosted in that URL?
I've tried
try {
URL url = new URL(FILE_NAME);
reader = new BufferedReader(new InputStreamReader(url.openStream()));
String word;
while ((word = reader.readLine()) != null)
//do code
reader.close();
} catch (IOException e) { e.printStackTrace(); }
but its throwing an exception everytime!
edit: This is the error beign thrown:
java.io.FileNotFoundException: http://www.hosting.com/words.bin
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at predictive.PredictivePrototype.signatureToWords(PredictivePrototype.java:73)
at predictive.Sigs2WordsProto.main(Sigs2WordsProto.java:11)
line 73 of predictiveprototype is a } , while line 11 of sig2words links to the above method.