I'm trying to make a simple Http server.
But I have a little problem.
If my /www
dir is in .jar file compilation, all workse perfect:
code:
private static final String DEFAULT_FILES_DIR = "/www";
....
private String getURLFromHeader(String header) {
//gettint url from header
....
return DEFAULT_FILES_DIR + url;
}
....
System.out.println("Resources: " + url + "\n");
System.out.println("Result code: " + code + "\n");
for index.html I become: Resources: /www/index.html Result code: 200
-> all works.
But when I make so:
private static final String DEFAULT_FILES_DIR = "D:/.../.../.../www"; // absolute pass;
....
....
server says "No man, i don't know what are you wont from me"! =)
and type: Resources: D:/.../.../.../www/index.html Result code: 404
-> file not found.
What it can be?
P.s. I tried to put private static final String DEFAULT_FILES_DIR = "D:\\...\\...\\...\\www";
but it wouldn't work!))))