Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Remote EFS designs

On Thu, May 28, 2009 at 10:50 PM, Chris Genly <chgenly@xxxxxxxxx> wrote:
> I think, in pre EFS times, IPath covered the workspace and file system.  Now
> IPath covers only the workspace.  The filesystem is replaced by the EFS
> which requires URIs instead of a path.

No, this is not correct. That is what *should* happen, but Path
enforces constraints based on the local operating systems'
requirements.

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox/components/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Path.java?root=RT_Project&view=markup

	/* (Intentionally not included in javadoc)
	 * @see IPath#isValidSegment(String)
	 */
	public boolean isValidSegment(String segment) {
		int size = segment.length();
		if (size == 0)
			return false;
		for (int i = 0; i < size; i++) {
			char c = segment.charAt(i);
			if (c == '/')
				return false;
			if (WINDOWS && (c == '\\' || c == ':'))
				return false;
		}
		return true;
	}

This prevents any Path being created with a \ or : in the name on
windows platforms, even when the EFS filing system has nothing to do
with windows filing systems. Ditto the / for all platforms. Basically,
it should not be up to the Path to determine if something is a valid
name or not; it should be delegated to the EFS implementation in
question.

Alex


Back to the top