fix file names
This commit is contained in:
parent
8bf718d3a9
commit
0630ca9a48
|
@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
# [v1.0.5-SNAPSHOT] - 2020-12-9
|
||||
Mongo Id in record
|
||||
Mongo Concessioni interface
|
||||
Added Files.fixFileNAme
|
||||
|
||||
|
||||
# [v1.0.4-SNAPSHOT] - 2020-12-9
|
||||
Projects Rest Interface
|
||||
|
|
|
@ -37,5 +37,12 @@ public class Files {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public static String fixFilename(String toFix) {
|
||||
if(toFix.contains(".")) {
|
||||
String prefix=toFix.substring(toFix.lastIndexOf("."));
|
||||
toFix=toFix.substring(0,toFix.lastIndexOf("."));
|
||||
return toFix.toLowerCase().replaceAll("[\\*\\+\\/\\\\ \\[\\]\\(\\)\\.\\\"\\:\\;\\|]","_")+prefix;
|
||||
}
|
||||
return toFix.toLowerCase().replaceAll("[\\*\\+\\/\\\\ \\[\\]\\(\\)\\.\\\"\\:\\;\\|]","_");
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue