code: public static String getDirectParent(URL entry) {
  		String path = entry.getPath();
  		int last = path.lastIndexOf('/');
  		if (last > 0) {
  			int first = path.lastIndexOf('/', last - 1);
  			if (first >= 0) {
  				return path.substring(first + 1, last);
  			} else {
  				return path.substring(0, last);
  			}
  		} else {
  			return "";
  		}
  	}
docs: Finds the direct parent of the path of the given URL. E.g.
  /parent/file.xml yields parent, but /parent/file.xml/ yields file.xml
  
  @param entry A location.
  @return The (bare) parent path.