Commit 4f0ec817 authored by adwisatya's avatar adwisatya
Browse files

Path map.json handler ok

parent 8c580162
#Mon, 27 Apr 2015 00:52:16 +0700
#Mon, 27 Apr 2015 01:02:47 +0700
C\:\\Users\\adwisatya\\Documents\\Semester\ 6\\Tugas\\IF3230\ Sister\\IF3230-Tugas-Besar-Sister-2015\\src\\server=
......@@ -17,6 +17,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.*;
import java.nio.file.Files;
import java.nio.file.Path;
......@@ -557,14 +558,17 @@ public class Client extends Thread{
}
public void loadMap(){
File f = new File("map.json");
System.out.println(f.getPath());
System.out.println(f.getAbsolutePath());
String fileName = "map.json";
String inputFilePath = null;
File jarFile;
try {
System.out.println(f.getCanonicalPath());
}
catch(Exception e) {}
jarFile = new File(Client.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
inputFilePath = jarFile.getParent() + File.separator + fileName;
} catch (URISyntaxException ex) {
Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
}
System.out.println(inputFilePath);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment