[英]Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 72
can someone help me with this one, im having a error like this有人可以帮我解决这个问题吗,我遇到了这样的错误
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
and this is my code这是我的代码
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"));
thank you in advance先感谢您
You have to remove the colons from your filename SEC_DOC_SUBMISSION_REPORT_2020-10-0709:54:27+0800.csv
.您必须从文件名
SEC_DOC_SUBMISSION_REPORT_2020-10-0709:54:27+0800.csv
中删除冒号。 It is a reserved character on Windows and you are not allowed to use any reserved character while naming Files, Paths, and Namespaces.它是 Windows 上的保留字符,在命名文件、路径和命名空间时不允许使用任何保留字符。 Checkout the Windows Naming Conventions
查看Windows 命名约定
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.