[英]java.nio.file.InvalidPathException: Illegal char <:> at index 2:
[英]Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 72
有人可以幫我解決這個問題嗎,我遇到了這樣的錯誤
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 72: D:/Users/cleyeza/Desktop/document/SEC_DOC_SUBMISSION_REPORT_2020-10-0709:54:27+0800.csv
這是我的代碼
String directoryPath = AppConfig.OUTPUT_PATH.value();
File dir = new File(directoryPath);
if(!dir.exists()){
dir.mkdirs();
}
Writer writer = Files.newBufferedWriter(Paths.get(directoryPath
+"/" +filename+".csv"));
先感謝您
您必須從文件名SEC_DOC_SUBMISSION_REPORT_2020-10-0709:54:27+0800.csv
中刪除冒號。 它是 Windows 上的保留字符,在命名文件、路徑和命名空間時不允許使用任何保留字符。 查看Windows 命名約定
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.