Community
Participate
Working Groups
Build Identifier: Version: 3.7.0 Build id: I20110613-1736 I planned to use isValidPath from org.eclipse.core.runtime.Path Unfortunatly it seems that this function is far from working. it only checks that path segments doesn't contain ':' Under windows, forbidden characters are : < (less than) > (greater than) : (colon) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk) Plus characters 1 to 31 I thing Linux is less restrictive. Reproducible: Always Steps to Reproduce: 1. try c:\sdsd/ <>/ /// / \\ isValidPath returns true 2. try c:\sdsd/ <>/ //:/ / \\ isValidPath returns false
Adding John to CC as he is the API guy but I believe this is the expected behaviour. An IPath represents a path object in the workspace and is not meant to be tied directly to the file-system.
Yes this is behaving as specified. IPath#isValidPath just checks that the segments are valid. isValidSegment just specifies that they cannot contain device or path separators. An IPath does not necessarily represent a local file system path on your local machine. It could be used to represent a file system path on another machine, or simply a hierarchical series of segments. There is a method IWorkspace#validateName that will do operating system specified checks.
Thanks a lot guys for clarification ! I appreciated it