1 文件名在操作系统中不允许出现 / \ " : | * ? < >
2 效验代码
String fileName="<>?.xml";
boolean isPass = fileName.matches("[^\\s\\\\/:\\*\\?\\\"<>\\|](\\x20|[^\\s\\\\/:\\*\\?\\\"<>\\|])*[^\\s\\\\/:\\*\\?\\\"<>\\|\\.]$");
System.out.println(isPass);
//结果: false