mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Making sure file names don't have spaces at the end
This commit is contained in:
parent
eec5c62704
commit
48f1e09a36
@ -169,8 +169,9 @@ public class FileUtil {
|
||||
public static String escapeFileName(String fileName) {
|
||||
//for now escaping /:"*?<>| (not valid in file name, at least on Windows)
|
||||
//with underscores. We are only keeping \ as it could be part of the path.
|
||||
return fileName.replaceAll("[\\p{Cntrl}/:\"*?<>|]+", "_");
|
||||
}
|
||||
// Also trim empty space characters at the end of file name.
|
||||
return fileName.replaceAll("[\\p{Cntrl}/:\"*?<>|]+", "_").trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the current user has read and write access to the dirPath.
|
||||
|
Loading…
x
Reference in New Issue
Block a user