Esempio n. 1
0
 private File createFileVertex(String path) {
   File fileVertex = new File();
   java.io.File file = new java.io.File(path);
   fileVertex.addAnnotation("filename", file.getName());
   fileVertex.addAnnotation("path", path);
   long filesize = file.length();
   long lastmodified = file.lastModified();
   fileVertex.addAnnotation("size", Long.toString(filesize));
   String lastmodified_readable =
       new java.text.SimpleDateFormat(simpleDatePattern).format(new java.util.Date(lastmodified));
   fileVertex.addAnnotation("lastmodified_unix", Long.toString(lastmodified));
   fileVertex.addAnnotation("lastmodified_simple", lastmodified_readable);
   return fileVertex;
 }
Esempio n. 2
0
 private File createLinkVertex(String path) {
   File linkVertex = new File();
   linkVertex.addAnnotation("path", path);
   linkVertex.addAnnotation("filetype", "link");
   return linkVertex;
 }