public String toString() {
return SimpleDateFormat.getInstance().format(this.getTime());
}
};
gc.setTimeInMillis(0);
FileObjectVFSResource element = (FileObjectVFSResource) itr.next();
// this is an extra defense against imaginary files.
FileType ft = null;
try {
ft = element.getFile().getType();
} catch (FileSystemException e) {
} catch (IOException e) {
}
FileSystemItem item = null;
if (ft != null && element.getFile().getType().equals(FileType.FOLDER)
&& fileSystemForm.getNetworkPlace().isAllowRecursive()) {
// if it is a folder
if(element.getLastModified() != null)
gc.setTime(element.getLastModified());
item = new FolderItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), res.getMount()
.getStore()
.getName(), fileSystemForm.getPath(), gc, element.getFile().getType().getName(), false, i);
} else if (ft != null && element.getFile().getType().equals(FileType.FILE)) {
// if it is a file
if(element.getLastModified() != null)
gc.setTime(element.getLastModified());
item = new FileItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), element.getContentLength()
.longValue(), gc, element.getFile().getType().getName(), false, i);
} else {
if (log.isInfoEnabled())
log.info("Unable to display file " + element.getDisplayName() + " as it is an imaginary file.");
warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
"vfs.imaginary.file",
element.getDisplayName()));
// decrement the counter as there is no file added.
i--;
}
if (item != null) {