It's not a secret anymore!*
The moose likes Java in General and the fly likes checking for file present in the directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "checking for file present in the directory" Watch "checking for file present in the directory" New topic
Author

checking for file present in the directory

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
Searching for the file in directory

There are 2 directories
1)D:\eclipse\POST_5227\gui\Trustdata
In this directory there are ".t05" files (ex Quick.t05)

After extracting name of the file example "Quick", adding a new extension to it.

example "Quick_printIt_1"

2) Checking this new file present in another directory
D:\eclipse\POST_5227\gui\print


How to check the existence of new file present in print folder?



pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
check out the java.io.File API description.

pascal
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Did you look at the "exists()" method in the java.io.File class?


[Jess in Action][AskingGoodQuestions]
 
wood burning stoves
 
subject: checking for file present in the directory