• Post Reply Bookmark Topic Watch Topic
  • New Topic

Listener  RSS feed

 
srinivasan ganesan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know if a file is present in a particular UNIX location. I'd like to know what listener I should use to detect the presence of that file from a servlet/jsp.
I'd appreciate any help.
Thanks in advance,
Srinivas
 
Kok Choon Ling
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i assume u know the file name and path that u want to check.
let say.
String file_name = "abc.txt";
String path = "/usr/data";
then u just use File object to check whether the file is existed or not :
File testFile = new File ( path + file_name );
if( testFile.exists() )
{
//exists
}
else
{
//Not exists
}
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!