0
我試圖訪問GeoLiteCity文件,它在我的本地機器上工作,但無法獲取雲(Azure)上的路徑。 文件保存恰好一樣層次:訪問雲環境中的本地文件
/src/main/resources/database/GeoLiteCity.dat
我的代碼:
void getFile() {
if (this.file == null) {
try {
URL url = this.getClass().getClassLoader().getResource("database/GeoLiteCity.dat");
this.file = new File(url.toURI());
System.out.println(file.getPath().toString());
} catch (Exception ex) {
System.out.println(file.getPath().toString(),ex);
}
}
}
您使用了什麼Azure服務? Azure WebApps或雲服務? –