int count = Math.max(0,path.length() - 2); int index = path.lastIndexOf(File.separatorChar,count); if(index == -1) index = path.lastIndexOf('/',count); if(index == -1) {   index = path.lastIndexOf(':'); }  return path.substring(0,index + 1);
return getParentOfPath(path);
	public static String getFileParent(String path)	{		int count = Math.max(0,path.length() - 2);		int index = path.lastIndexOf(File.separatorChar,count);		if(index == -1)			index = path.lastIndexOf('/',count);		if(index == -1)		{			// this ensures that getFileParent("protocol:"), for			// example, is "protocol:" and not "".			index = path.lastIndexOf(':');		}		return path.substring(0,index + 1);	}