Java Code Examples for javax.jcr.RepositoryException#toString()

The following examples show how to use javax.jcr.RepositoryException#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RepositoryCFile.java    From jackrabbit-filevault with Apache License 2.0 6 votes vote down vote up
public ConsoleFile[] listFiles() throws IOException {
    try {
        if (item.isNode()) {
            Node node = (Node) item;
            ArrayList<RepositoryCFile> ret = new ArrayList<RepositoryCFile>();
            PropertyIterator piter = node.getProperties();
            while (piter.hasNext()) {
                ret.add(new RepositoryCFile(piter.nextProperty()));
            }
            NodeIterator niter = node.getNodes();
            while (niter.hasNext()) {
                ret.add(new RepositoryCFile(niter.nextNode()));
            }
            return ret.toArray(new RepositoryCFile[ret.size()]);
        } else {
            return ConsoleFile.EMPTY_ARRAY;
        }
    } catch (RepositoryException e) {
        throw new IOException(e.toString());
    }
}
 
Example 2
Source File: AggregateCFile.java    From jackrabbit-filevault with Apache License 2.0 6 votes vote down vote up
public ConsoleFile[] listFiles() throws IOException {
    try {
        List<? extends Aggregate> files = aggregate.getLeaves();
        if (files == null || files.isEmpty()) {
            return ConsoleFile.EMPTY_ARRAY;
        }
        AggregateCFile[] ret = new AggregateCFile[files.size()];
        int i=0;
        for (Aggregate node: files) {
            ret[i++] = new AggregateCFile(node);
        }
        return ret;
    } catch (RepositoryException e) {
        throw new IOException(e.toString());
    }
}
 
Example 3
Source File: PropertyValueArtifact.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
private void assertOpen() throws IOException {
    if (stream == null) {
        if (closed) {
            throw new IOException("Stream already closed.");
        }
        try {
            stream = getValue().getStream();
        } catch (RepositoryException e) {
            throw new IOException("Error while opening stream: " + e.toString());
        }
    }
}
 
Example 4
Source File: AggregateCFile.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
public ConsoleFile getFile(String path, boolean mustExist)
        throws IOException {
    try {
        Aggregate node = aggregate.getManager().getRoot();
        if (!path.equals("/")) {
            node = this.aggregate.getAggregate(path);
            if (node == null) {
                throw new FileNotFoundException(path);
            }
        }
        return new AggregateCFile(node);
    } catch (RepositoryException e) {
        throw new IOException("Error while retrieving file: " + e.toString());
    }
}
 
Example 5
Source File: VaultFsCFile.java    From jackrabbit-filevault with Apache License 2.0 5 votes vote down vote up
public ConsoleFile getFile(String path, boolean mustExist) throws IOException {
    try {
        VaultFile ret = file.getFileSystem().getFile(file, path);
        if (ret == null) {
            throw new FileNotFoundException(path);
        }
        return new VaultFsCFile(ret);
    } catch (RepositoryException e) {
        throw new IOException(e.toString());
    }
}