vokunya
26 Jan 2012, 9:31 AM
Hi,
i have a webapp - REST web service
there is a folder with content there, for example:
/path_to_folder/folder
-file1.xsd
-file2.xsd
-subfolder_1
------file1_1.xsd
------subfolder_2
------------subfolder_2_1
------------file_2_1_1
------file_2_1
and so on
and i need to represent that tree in TreeGrid in another gxt webapp.
perhaps, i can do on my ress webapp something like
{
//...
final Collection<File> all = new ArrayList<File>();
addFilesRecursively(new File("path_to_folder/folder"), all);
//....
//send Collection<File> all to gxt webapp
//...
}
private static void addFilesRecursively(File file, Collection<File> all) {
final File[] children = file.listFiles();
if (children != null) {
for (File child : children) {
all.add(child);
addFilesRecursively(child, all);
}
}
}
and i can't to invent an algorithm to represent
Collection<File> all in TreeGrid
any ideas?
or some another problem solution?
thanks
i have a webapp - REST web service
there is a folder with content there, for example:
/path_to_folder/folder
-file1.xsd
-file2.xsd
-subfolder_1
------file1_1.xsd
------subfolder_2
------------subfolder_2_1
------------file_2_1_1
------file_2_1
and so on
and i need to represent that tree in TreeGrid in another gxt webapp.
perhaps, i can do on my ress webapp something like
{
//...
final Collection<File> all = new ArrayList<File>();
addFilesRecursively(new File("path_to_folder/folder"), all);
//....
//send Collection<File> all to gxt webapp
//...
}
private static void addFilesRecursively(File file, Collection<File> all) {
final File[] children = file.listFiles();
if (children != null) {
for (File child : children) {
all.add(child);
addFilesRecursively(child, all);
}
}
}
and i can't to invent an algorithm to represent
Collection<File> all in TreeGrid
any ideas?
or some another problem solution?
thanks