commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Inma Marín <i...@dif.um.es>
Subject How to obtain a file last modification date
Date Wed, 02 Jan 2008 16:22:06 GMT
Hi all,

 

I would like to know how to get a file last modification time, if it is
possible. The file is included in a multipart request and is obtained as
follow:

 

 

 

            org.apache.commons.fileupload.DiskFileUpload fu = new
org.apache.commons.fileupload.DiskFileUpload();

            java.util.List fileItems = fu.parseRequest(request);

            java.util.Iterator it = fileItems.iterator();

 

            org.apache.commons.fileupload.FileItem item = null;

            while (it.hasNext()){

  item = (org.apache.commons.fileupload.FileItem) it.next();

        

                if (item.isFormField()) { // Es un campo normal así que
comprobamos el nombre y lo recuperamos.

                        String itemName = item.getFieldName();

                        

                        if (itemName.equals("…")){

                        }

                        

                }else{ 

                    org.apache.commons.fileupload.FileItem fi =
(org.apache.commons.fileupload.FileItem)item;

                    doc = fi.getString();  

                    

                    //File name

                    String fname = item.getName();

 

                    //File size

                    Strinf fsize = String.valueOf(item.getSize());

 

                //Last modification date??

 

 

Could anybody be so kind as to help me, please?

 

Thank you very much in advance.

 

Inma.

 

------------------------------------------------------------
Inmaculada Marín López
Edificio ATICA - Planta baja
Campus de Espinardo
Universidad de Murcia
Teléfono +34 968 367906
e-mail: inma@dif.um.es
------------------------------------------------------------

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message