public static String[] translatePathName(String path){
  path=prettifyPath(path);
  if (path.indexOf('/') != 0)   path='/' + path;
  int index=path.lastIndexOf('/');
  if (index == path.length() - 1)   path=path.substring(0,path.length() - 1);
  index=path.lastIndexOf('/');
  String name;
  if (index == -1) {
    name=path;
    path="/";
  }
 else {
    name=path.substring(index + 1);
    path=path.substring(0,index + 1);
  }
  return new String[]{path,name};
}

public static String [ ] translatePathName ( String path ) { path = prettifyPath ( path ) ; if ( path . indexOf ( '/' ) != 0 ) path = '/' + path ; int index = path . lastIndexOf ( '/' ) ; if ( index == path . length ( ) - 1 ) path = path . substring ( 0 , path . length ( ) - 1 ) ; index = path . lastIndexOf ( '/' ) ; String name ; if ( index == - 1 ) { name = path ; path = "/" ; } else { name = path . substring ( index + 1 ) ; path = path . substring ( 0 , index + 1 ) ; } return new String [ ] { path , name } ; }
transalte a path in a proper form and cut name away example susi \ petere - > / susi / and peter
