commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rai Singh" <>
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:
when calling resolveFile on FileSystemManager.

However, when I call the following, I receive a NullPointerException on the
call to getLastModifiedTime() because DefaultFileContent's default
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.

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