如题所述
public String getAbsolutepath() {
String fileUrlPath = FileL.getPathPart(this.getClass().getResource("/")
.getPath());
String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith("win")) {
fileUrlPath = fileUrlPath.substring(1, fileUrlPath.length());
}
return fileUrlPath;
}
String fileUrlPath = FileL.getPathPart(this.getClass().getResource("/")
.getPath());
String os = System.getProperty("os.name");
if (os.toLowerCase().startsWith("win")) {
fileUrlPath = fileUrlPath.substring(1, fileUrlPath.length());
}
return fileUrlPath;
}
温馨提示:答案为网友推荐,仅供参考