Home arrow static arrow Java Programming [Archive] - Add filenames and timestamp of files in a folder to array
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Add filenames and timestamp of files in a folder to array
This topic has 2 replies on 1 page.

Posts:92
Registered: 9/9/03
Add filenames and timestamp of files in a folder to array  
Jun 28, 2004 9:00 PM



 
Hi guys,
By the way I want to read a folder's content and insert the filenames of the files into an array together with it's last modified date.

I managed to insert the filenames into the String but not the timestamp. Do u have any idea on this. I am using the FileList.jar and WCardDirFilter.jar

My code
FileList mylist = new FileList();mylist.generateFileListRecursive(directory);


Thank u.
 

Posts:111
Registered: 12/21/97
Re: Add filenames and timestamp of files in a folder to array  
Jun 28, 2004 10:47 PM (reply 1 of 2)



 
Pardon my ignorance, but I have no idea where you got the 2 jar files from.

Anyway, to get the time stamp of a file, use the [url=http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#lastModified()]long lastModified()[/url] method in [url=http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html]java.io.File[/url].
 

Posts:92
Registered: 9/9/03
Re: Add filenames and timestamp of files in a folder to array  
Jun 29, 2004 8:06 PM (reply 2 of 2)



 
Hi aghost.

Actually the jar files were passed to me by a friend. But we couldn't edit the jar files to know the content.
I actually want the filenames indented with the last modified date of the file shown in the array.

I am still trying to incorporate the code into my codes.

I'll post back if i am not successful. Thank you.
 
This topic has 2 replies on 1 page.