usmanazizgroupdocs
4/15/2016 - 10:32 AM

LoadFileTreeListForCustomPath.java

// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java
try {
	// Setup GroupDocs.Viewer config
	ViewerConfig config = Utilities.getConfiguration();
	// Create image handler
	ViewerImageHandler imageHandler = new ViewerImageHandler(config);

	// Load file tree list for custom path
	FileTreeOptions options = new FileTreeOptions(customPath);

	FileTreeContainer container = imageHandler.loadFileTree(options);

	for (FileDescription node : container.getFileTree()) {
		if (node.isDirectory()) {
			System.out.println("Guid: " + node.getGuid() + " | Name: " + node.getName()
					+ " | LastModificationDate: " + node.getLastModificationDate());
		} else {
			System.out.println("Guid: " + node.getGuid() + " | Name: " + node.getName() + " | Document type: "
					+ node.getDocumentType() + " | File type: " + node.getFileType() + " | Extension: "
					+ node.getExtension() + " | Size: " + node.getSize() + " | LastModificationDate: "
					+ node.getLastModificationDate());
		}
	}
} catch (Exception exp) {
	System.out.println("Exception: " + exp.getMessage());
	exp.printStackTrace();
}