Exemplo n.º 1
0
 // Set type of file as name of the element
 private void setType(Element element, Path path) {
   if (Files.isDirectory(path)) {
     element.setLocalName(FileType.DIR.getName());
     return;
   } else if (Files.isRegularFile(path)) {
     element.setLocalName(FileType.FILE.getName());
     return;
   } else if (Files.isSymbolicLink(path)) {
     element.setLocalName(FileType.SYMLINK.getName());
     return;
   } else element.setLocalName(FileType.OTHER.getName());
 }