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