What is meant by canonical path and canonical file?
Location: http://www.jguru.com/faq/view.jsp?EID=42115 Created: Apr 28, 2000 Modified: 2001-08-18 17:13:15.078 Author: Ken Graham (http://www.jguru.com/guru/viewbio.jsp?EID=26759) Question originally posed by sharma MR (http://www.jguru.com/guru/viewbio.jsp?EID=4939 First – both Absolute and Canonical forms are OS dependent per the API documentation for java.io.File. Second – Absolute is not absolute. It is not a resolved path name. If File f is not already an absolute path name, according to OS dependent rules, then it simply prepends the value of System.getProperty(“user.dir”). However, don’t think that you can use setProperty(“user.dir”,otherdir), because it will be ignored under Windows. At some future point Sun may change their mind regarding this. :-))))) Thirdly – Canonical is resolved, but in an OS dependent form. Therefore, if you want to really know about the name of the file avoid either of these two methods, and use File.toURL().toExternalForm() instead. The form is resolved
Related Questions
- Sometimes when I open the File Finder, Multiple Choice Question Maker, or other utilities, the path does not show up. What is the problem?
- In the Enterprise version Administrator page, I can define multiple URL/File path mappings; how do I use that in the CFXGS tag?
- What is meant by canonical path and canonical file?