public static String dirpart ( final String path ) { int s = path . lastIndexOf ( File . separatorChar ) ; if ( s != - 1 ) { return path . substring ( 0 , s ) ; } else { return null ; } }
Returns the directory part of path string .