File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to detect a file is existing or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to detect a file is existing or not?" Watch "How to detect a file is existing or not?" New topic
Author

How to detect a file is existing or not?

ziqiang wu
Greenhorn

Joined: Jun 18, 2001
Posts: 25
Hi all: Could you please tell me how my java code detect a file is existing or not???
Thanks!
ziqiang wu
Greenhorn

Joined: Jun 18, 2001
Posts: 25
I know I can use File file=new File("****.***"); if(file.exists()) do... else do.... but I want to use jsp include tag to detect a file is exist or not. currently, if a file (***.html) exist, then jsp include it and show up, if a file(***.html) does not exist, then jsp include nothing, and no exception. So I want to find some way, if jsp include nothing, then do...something.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to detect a file is existing or not?
 
Similar Threads
Detect new file in a directory
JSP include tag problem, please help!
Detect new file in a directory
java redirection
stop a running thread without exiting the jvm