web applications - How to display content of text file named with current date using java program -
web applications - How to display content of text file named with current date using java program -
i working on web application in takes action log every min i.e.., action performed appended text file current date name , if no action performed append current time stamp in same file. everyday 1 new file created , action performed appended in file whole day. want is, files nowadays in d:\ -->(presentdate)<--.txt , when give particular date in same format of file name in "text field" , click on submit in web application has show file nowadays in d drive hyper link(if nowadays in drive) , when click on hyperlink should show content in file. want know how search file in particular folder/drive without mentioning file name straight searching files having file names in specific format(example: 27_06_2014.txt).any suggestions helpful. give thanks you.
   string path = "d:" + file.pathseparator + filesearched + ".txt";  file f = new file(path);  if(f.exists()) {          //do stuff  }  //i dont know why search them list anyways  file dir = new file("d:");  dir.mkdir();  for(string s : dir.list()){      if(s.equalsignorecase(filesearched)){          //do stuff      } }    
here's documentation java.io.file class
 java web-applications cmd 
 
Comments
Post a Comment