1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.corbaservices; |
2 |
> |
package uk.org.iscream.cms.corbaservices; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
|
import java.net.*; |
98 |
|
String data = ""; |
99 |
|
BufferedReader reader = new BufferedReader(new FileReader(file)); |
100 |
|
while(reader.ready()) { |
101 |
< |
data += reader.readLine(); |
102 |
< |
data += "\n"; |
101 |
> |
String line = reader.readLine(); |
102 |
> |
if(line != null) { |
103 |
> |
data += line + "\n"; |
104 |
> |
} |
105 |
|
} |
106 |
|
return data; |
107 |
|
} |
232 |
|
do { |
233 |
|
line = reader.readLine(); |
234 |
|
// ah, this contains the URL |
235 |
< |
if(line.startsWith("GET")) { |
235 |
> |
if(line.startsWith("GET ")) { |
236 |
|
// strip off "GET " |
237 |
|
url = line.substring(4); |
238 |
|
// strip off anything past the URL |
239 |
< |
url = url.substring(0, url.lastIndexOf(' ')); |
239 |
> |
if(url.lastIndexOf(' ') != -1) { |
240 |
> |
url = url.substring(0, url.lastIndexOf(' ')); |
241 |
> |
} |
242 |
|
} |
243 |
|
} while(!line.equals("")); |
244 |
|
// check the URL is allowed |