public static String toValidFileName ( String fileName ) { // adds MAX_VALUE to eliminate minus character which might be returned by hashCode() return Long . toString ( ( long ) fileName . hashCode ( ) + Integer . MAX_VALUE ) ; }
Converts characters of passed string and replaces to hash which can be treated as valid file name .