Skip to content

Commit

Permalink
final submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Lavelle committed Feb 3, 2018
1 parent 24eea80 commit 004aa76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
Binary file modified WebWorker.class
Binary file not shown.
21 changes: 0 additions & 21 deletions WebWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ private void readHTTPRequest(InputStream is){
t.nextToken(); // skips "GET"
file = t.nextToken();


while (true) {
try {
while (!r.ready()) Thread.sleep(1);
Expand Down Expand Up @@ -179,25 +178,5 @@ private void writeContent(OutputStream os) throws Exception
System.err.println(file + " not found");
os.write("<h1>404 Not Found</h1>".getBytes());
} // end catch
// os.write("HTTP/1.1 200 Ok\n".getBytes());

/* filename = filename.substring(1); // removes forward-slash from string "file"
dir = new File(file); // creates File object from string "file"
if (dir.exists()){
FileReader reader = new FileReader(dir);
BufferedReader buffer = new BufferedReader(reader);
line = buffer.readLine();
while (line != null){
os.write(line.getBytes());
line = buffer.readLine();
System.out.println("in while");
} // end while
buffer.close();
} // end if
else{
os.write("<p> 404 NOT FOUND </p>".getBytes());
} // end else
*/
} // end writeContent
} // end class
7 changes: 7 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<project name="program1"
default="compile">
<target name="compile">
<javac srcdir="."
destdir="."/>
</target>
</project>

0 comments on commit 004aa76

Please sign in to comment.