我正在尝试创建一个文件,但文件路径是通过使用一些内部变量和标签的 String Concats 构造的,我收到以下错误:
Exception in thread "main" java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at CopyEJ.CopyEJ.main(CopyEJ.java:133)
是否有构建此类文件的标准方法?
String s_path = text_dir + "\\" + time_stmp + "_" + "Session" + "_" + file_name;
File ssw = new File(s_path);
ssw.createNewFile(); //Errors Out here