public static String createEncodedName ( File source ) { String fileURI = source . toURI ( ) . toString ( ) ; String userDirURI = new File ( System . getProperty ( "user.dir" ) ) . toURI ( ) . toString ( ) ; fileURI = fileURI . replace ( userDirURI , "" ) ; String encodedName = fileURI . substring ( fileURI . lastIndexOf ( ' ' ) + 1 ) . replace ( "%20" , "-" ) . replace ( ' ' , ' ' ) ; return encodedName ; }
Creates a directory name from a file path .