상대 경로를 절대 경로로 바꿔주기
public static String getCanonicalPath(String relative, String base) {
String canonicalPath = null;
File relativeFile = new File(relative);
if(relativeFile.isAbsolute()) {
canonicalPath = relativeFile.getAbsolutePath();
} else {
File canonicalFile = new File(base, relative);
try {
canonicalPath = canonicalFile.getCanonicalPath();
} catch(IOException e) {
e.printStackTrace();
}
}
return canonicalPath;
}
FilePathParser.getCanonicalPath("../../temp.txt", "/Users/Stylekai/Documents/");