1. File.getCanonicalPath() failure examples stackoverflow.comDoes anyone have an experience or know when the method |
2. What is the different between getAbsolutePath and getCanonicalPath stackoverflow.comJava Newbie question : what is the different between getAbsolutePath() and getcanonicalPath() in file class. I can't get the meaning from the documents. in below code, their output are the same.
|
3. Why getCanonicalPath throws checked exception while getAbsolutePath does not? stackoverflow.comI know the differences between the two by reading some related text. But I am curious that why |
4. File.getCanonicalPath coderanch.comHai Rahul By reading this example you can know difference between absolutepath and canonical path Assume that you have a text file in c:\windows\jcp\file1.txt,you compile and run the file in d:\somename\some> File f=new File("../jcp/file1.txt"); System.out.println("ab path"+f.getAbsolutePath());//this will return d:\somename\some..\jcp\file1.txt System.out.println("ca path"+f.getCanaonicalPath());//this will return d:\somename\jcp\file1.txt if u give like this File f1=new File("file.txt")both the answers will be same. |
5. getCanonicalPath() and getAbsolutePath() coderanch.comI have tried the above two methods using all possible forms of the File object . eg. File f = new File("abc.txt") File f = new File("\\dir1\\abc.txt") File f = new File("..\\dir1\\abc.txt") Can someone tell me exactly what these 2 methods do ? I seem to get unexplainable answers for all options when the aboce file "abc.txt" exists and when it ... |
6. getCanonicalPath vs getAbsolutePath coderanch.comi am new to java servlets. i am looking at some code and in tht code people used getCanonicalPath. wht actually getCanonicalPath returns please help me in this regard . i looked for old posts where people are saying tht canonical path returns short path where as absolute path retruns long path but i havent understood wht this short path is ... |
7. java.lang.OutOfMemoryError, probably due to many File.getCanonicalPath() forums.oracle.com |