File
Filename - Replace Invalid Characters
List of Invalid Keyboard Characters for a Windows XP filename
Regex expression to replace invalid filename characters.
Replace invalid (and a few other characters from a file name) with an underline:
String cleanFilename(final String fileName) { return fileName.replaceAll("[\\\\/:*%?\"<>|&\\]=]", "_"); }