java - How to get the file location using the file path? -
in eclipse, when right click on file want input in project, shows 2 things: path: /swt/src/data.txt location: c:\users\yoshikawa\workspace\swt\src\data.txt
is there way can location (c:\users\yoshikawa\workspace\swt\src\data.txt) know path (/swt/src/data.txt) ?
ex.
public string readfile(string file_path) { //search current project directory return file_location }
public string readfile(string file_path){ file f = new file(file_path); return f.getabsolutepath(); }
Comments
Post a Comment