}
private FileInfo fileToFileInfo(File file) throws VFSException {
try {
FileInfo inf = new FileInfo(file.getPath().substring(rootlen));
//FileInfo inf = new FileInfo(file.toURL().getPath().substring(rootlen));
inf.setCreateDate(new Date(file.lastModified()));
inf.setFileType(file.isFile() ? FileInfo.TYPE_FILE : FileInfo.TYPE_DIR);
inf.setLastModified(new Date(file.lastModified()));
inf.setLength(file.length());
inf.setMime("application/octet-stream");
String tag = (String) tags.get(file);
inf.setTag(tag == null ? String.valueOf(inf.getLastModified().getTime()) : tag);
return inf;
} catch(IOException ex) {
log.info("Exception while getting file information: ", ex);
return null;
}