System.out.print(path.getAbsolutePath()+" vs. "+relativeToPath.getAbsolutePath()+"\n\t");
	public static File getRelativeName(File path, File relativeToPath)	{		System.out.print(path.getAbsolutePath()+" vs. "+relativeToPath.getAbsolutePath()+"\n\t");		// make both paths absolute		if (!path.isAbsolute())			path = path.getAbsoluteFile();		if (!relativeToPath.isAbsolute())			relativeToPath = relativeToPath.getAbsoluteFile();					// make both cannonical		try		{			path = path.getCanonicalFile();			relativeToPath = relativeToPath.getCanonicalFile();		}		catch (IOException ioe)		{			return path;		}				// make relativeToPath directory		if (!relativeToPath.isDirectory())			relativeToPath = relativeToPath.getParentFile();					String strPath;		if (path.isDirectory())			strPath = path.getAbsolutePath()+File.separator;		else			strPath = path.getAbsolutePath();		String strRelativeToPath = relativeToPath.getAbsolutePath()+File.separator;				// get common part of path		int commonLength = 0;		int minLength = Math.min(strPath.length(), strRelativeToPath.length());		while (commonLength < minLength && 			   strPath.charAt(commonLength) == strRelativeToPath.charAt(commonLength))			commonLength++;					// if none, return entire path		if (commonLength == 0)			return path;					// strip off common part to separator		// there should be no separator in commonLength		commonLength = strPath.lastIndexOf(File.separatorChar, commonLength-1);					// if none, return entire path		if (commonLength == 0)			return path;		String commonPath = strPath.substring(0, commonLength);		StringBuffer resultingRelativePath = new StringBuffer();						//calculcate "step downs"		final String stepDown = File.separator+"..";		while (relativeToPath.getParent()!=null &&		// needed to handle "<driveLetter>:" to "<driveLetter>:/" comparison  			   !relativeToPath.getAbsolutePath().equals(commonPath))		{			resultingRelativePath.append(stepDown);			relativeToPath = relativeToPath.getParentFile();		}				// move up to path		resultingRelativePath.append(strPath.substring(commonLength));			return new File(resultingRelativePath.substring(1));	}