jQuery in Action, 2nd edition*
The moose likes I/O and Streams and the fly likes Fetching Files with filename Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Fetching Files with filename" Watch "Fetching Files with filename" New topic
Author

Fetching Files with filename

sk mehrotra
Ranch Hand

Joined: Oct 27, 2005
Posts: 34
Hi,
How can i fetch the files from a directory on its name on the user parameter, i.e on the Date as if the user specify date then files should be displayed between 01_05_2009 to 03_05_2009
Eg: filename_01_05_2009.txt, filename_02_05_2009.txt, filename_03_05_2009.txt, filename_04_05_2009.txt.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Use a SimpleDateFormat to parse your file names into Date objects:
The quotes enable you to add "filename" and ".txt" as literal text.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sk mehrotra
Ranch Hand

Joined: Oct 27, 2005
Posts: 34
Thanks,
I need to get the files on the date and name of the file, i.e
If filename is like ABCD_1111_2222_10-MAR-2008.txt in this case we'll be knowing the "ABCD" and ""10-MAR-2009" and secondly we need to search the files on the date range provide through the parameters, i.e
if user provide the date range between 10-mar-2009 and 15-mare-2009, then search of files would be between 10-mar-2009 to 15-mar-2009, i.e file would be between ABCD_1111_2222_10-MAR-2008.txt to ABCD_1111_2222_15-MAR-2008.txt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fetching Files with filename
 
Similar Threads
Redirecting to other Web Resource
Work with files
Work with files
Sorting Array of files by descending date and time format
documet viewer