Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling function like isDirectory(), lastModified() in JSP

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello everyone,

I have a little script below:
Arrays.sort( strFiles ) ;
// display list of matching file names
out.println( &quot;<ol>&quot; ) ;
for ( int k = 0 ; k < strFiles.length ; k++ )
out.println( &quot;<li>&quot; + strFiles[k] + &quot;</li>&quot; ) ;
out.println( &quot;</ol>&quot; ) ;

In my C:\test directroy I have 2 files, test.htm (2K) and test2.htm (3K). The script above will displays these two files in my C:\test directory as output:
1. test1.htm
2. test2.htm

I'd like to have function like isDirectory(), lastModified(), and fileSize(), so that it will displays more information about this file. So the output might be something.
1. test1.htm 2K on April 3, 2002 at 8:04 PM.
2. test2.htm 3K on April 4, 2002 at 4:14 PM.

If you could help me how to call or write the function to make this work, I'll appreciate it very much.

Regards,
Vivian
 
Oh, in addition, I'd like it to be in a form, where user can select which file, test1.htm or test2.htm (or whatever *.htm file exists in the c:\test directory). When a user select a file such as test1.htm, click submit, it will show test1.htm fileSize and its lastModified.

I'm new to JSP and I've spent so long on this and still don't know how to solve it, please help me.

Regards,
Vivian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top