|
|
|
@ -8,10 +8,10 @@ import java.util.List;
|
|
|
|
|
public class DirectoryStructureToJson {
|
|
|
|
|
|
|
|
|
|
public static Node getNode(File fileNode) throws IOException{
|
|
|
|
|
if(fileNode.getAbsoluteFile().isDirectory()){
|
|
|
|
|
return new Node(fileNode.getName(),fileNode.getAbsolutePath(),"directory", getDirList(fileNode));
|
|
|
|
|
if(fileNode.isDirectory()){
|
|
|
|
|
return new Node(fileNode.getName(),"directory", getDirList(fileNode));
|
|
|
|
|
}else{
|
|
|
|
|
return new Node(fileNode.getName(),fileNode.getAbsolutePath(),"file",null);
|
|
|
|
|
return new Node(fileNode.getName(),"file",null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -31,7 +31,7 @@ public class DirectoryStructureToJson {
|
|
|
|
|
|
|
|
|
|
public Node() { }
|
|
|
|
|
|
|
|
|
|
public Node(String text, String location, String type, List<Node> children) {
|
|
|
|
|
public Node(String text, String type, List<Node> children) {
|
|
|
|
|
this.text = text;
|
|
|
|
|
this.type = type;
|
|
|
|
|
this.children = children;
|
|
|
|
|