commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rai Singh" <raigsi...@gmail.com>
Subject [VFS] Retrieving a FileContent instance
Date Tue, 21 Feb 2006 17:34:49 GMT
I am trying to get a FileContent object from a FileObject
so that I can retrieve the value from getLastModifiedTime().
I am to successfully create FileObject using the following URI:
jar:file:/c:/neo/code/dist/crosssell.jar
when calling resolveFile on FileSystemManager.

However, when I call the following, I receive a NullPointerException on the
call to getLastModifiedTime() because DefaultFileContent's default
getLastModifiedTime()
method is invoked and it is simply not implemented to do anything useful.

  // fsManager is a DefaultFileSystemManager instance.
   FileObject fileObject = fsManager.resolveFile(deployFile.getFileName());
   FileContent fileContent = fileObject.getContent();

   long lastModTime = fileContent.getLastModifiedTime();


What is the correct way to reference a FileContent object. In my case,
I am interested in FileContent for jar files.

If I am misusing the API, please advise.
Thanks,
Rai

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