public static String getAbsolutPathWithoutFilename ( final File file ) { final String absolutePath = file . getAbsolutePath ( ) ; int lastSlash_index = absolutePath . lastIndexOf ( "/" ) ; if ( lastSlash_index < 0 ) { lastSlash_index = absolutePath . lastIndexOf ( "\\" ) ; } return absolutePath . substring ( 0 , lastSlash_index + 1 ) ; }
Gets the absolut path without the filename .