- if (node.isNodeType("nt:file")) {
-
- Node child = node.getNodes().nextNode();
- if (!child.isNodeType("nt:resource")) {
- Error.show("Cannot open file children Node that are not of 'nt:resource' type.");
- return;
- }
- BufferedInputStream fis = null;
-
- try {
- fis = (BufferedInputStream) child
- .getProperty("jcr:data").getBinary()
- .getStream();
-
- String name = node.getName();
-
- // Instantiate the generic object that fits for
- // both
- // RCP & RAP.
- FileHandler fh = new FileHandler();
- fh.openFile(name,
- fis);
- //fh.openFile(file);
- } catch (Exception e) {
- throw new ArgeoException(
- "Stream error while opening file", e);
- } finally {
- IOUtils.closeQuietly(fis);
- }
+ if (node.isNodeType(NodeType.NT_FILE)) {
+ String name = node.getName();
+ String id = node.getIdentifier();
+ // For the file provider to be able to browse the
+ // various
+ // repository.
+ // TODO : enhanced that.
+ jfp.setRootNodes((Object[]) nodeContentProvider
+ .getElements(null));
+
+ fh.openFile(name, id);