File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File existing

 
mike cool
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i created a method that will create a file in spacific path ..
no i close the app and reopen it , now i want check if the file exists or not , i know there is a method in File class exists()-boolean but this method will not allow me to choose the path ?? coz i think it will check in the project path not the path that i creat the file to ....??
 
Sri Ram
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The API for File says,

File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname.


And for the method exist says
Tests whether the file or directory denoted by this abstract pathname exists.


U can use File.exist() to check if the file exist without any problem.
 
Dave Jones
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you would like, here's a little code segment for yer' ...
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic