public static String createDirectoryPath ( String source ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createDirectoryPath" , source ) ; String directoryPath = null ; if ( source != null ) { directoryPath = "" ; final StringTokenizer tokenizer = new StringTokenizer ( source , "\\/" ) ; while ( tokenizer . hasMoreTokens ( ) ) { final String pathChunk = tokenizer . nextToken ( ) ; directoryPath += pathChunk ; if ( tokenizer . hasMoreTokens ( ) ) { directoryPath += File . separator ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createDirectoryPath" , directoryPath ) ; return directoryPath ; }
Replaces forward and backward slashes in the source string with File . separator characters .