Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-core-dev] Pathology, take two


Without giving more specific examples, let me try to clarify the purpose of the two methods.  fromOSString would be used to parse paths from *all* external sources, including all of those you list below (user input, and output of java.io.File/URI/URL methods you mention).  The *only* purpose of fromString would be to parse the output of a previous IPath.toString call. The only purpose here is to have a platform-neutral encoding of a path as a string that is suitable for serializing paths in data files so they can be read back in on other platforms.  It may well be that the method names I chose are too similar, and would cause inadvertant use of the inappropriate fromString method on strings from other sources.  Perhaps fromToString would be more to the point, though possibly even more confusing.




"Ed Burnette" <Ed.Burnette@xxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

10/05/2004 05:52 PM

Please respond to
platform-core-dev

To
<platform-core-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-core-dev] Pathology, take two





The difference between Path.fromString() and Path.fromOSString() is really subtle. Can you provide some more examples of inputs and outputs of these functions (as would go into creating a testcase)?
 
Also some more guidance about which one to call would be helpful. For example, which would you use for paths entered by a user in a dialog? Paths that come from a user written config file? Paths that come from a message file? Paths hardcoded in a Java program? Output from URI.getPath()? URL.getPath()? File.getPath(), .getAbsolutePath(), and .getCanonicalPath()? Etc....
 

Back to the top