public static String replaceInvalidCharacters(String source){
  source=source.replaceAll(": "," - ");
  source=source.replaceAll(":","-");
  return source.replaceAll("([\"\\\\:<>|/?*])","");
}

public static String replaceInvalidCharacters ( String source ) { source = source . replaceAll ( ": " , " - " ) ; source = source . replaceAll ( ":" , "-" ) ; return source . replaceAll ( "([\"\\\\:<>|/?*])" , "" ) ; }
replaces all invalid / illegal characters for filenames with " " < br > except the colon , which will be changed to a dash
