Package org.apache.jackrabbit.standalone.cli

Examples of org.apache.jackrabbit.standalone.cli.CommandException


            log.debug("importing filesystem from " + file + " to node "
                    + parent);
        }

        if (file == null) {
            throw new CommandException("exception.fspath.is.null");
        }

        File f = new File(file);

        if (!f.exists()) {
            throw new CommandException("exception.file.not.found",
                new String[] {
                    file
                });
        }
View Full Code Here


            printValue(ctx, n.getNode("jcr:content").getProperty("jcr:data")
                .getValue());
        } else if (n.isNodeType("nt:resource")) {
            printValue(ctx, n.getProperty("jcr:data").getValue());
        } else {
            throw new CommandException("exception.cat.unsupported.type",
                new String[] {
                    n.getPrimaryNodeType().getName()
                });
        }
    }
View Full Code Here

                        sb.append(' ');
                    }
                }
                text[column] = sb.toString();
            } else {
                throw new CommandException("exception.illegalargument");
            }
            column++;
        }
        printRow(ctx, width, text);
    }
View Full Code Here

            log.debug("importing filesystem from " + file + " to node "
                    + parent);
        }

        if (file == null) {
            throw new CommandException("exception.fspath.is.null");
        }

        File f = new File(file);

        if (!f.exists()) {
            throw new CommandException("exception.file.not.found",
                new String[] {
                    file
                });
        }
View Full Code Here

        File file = new File(to);

        // Check if there's a file at the given target path
        if (file.exists() && !overwrite) {
            throw new CommandException("exception.file.exists", new String[] {
                to
            });
        }

        // If it doesn't exists create the file
View Full Code Here

        boolean overwrite = Boolean
            .valueOf((String) ctx.get(this.overwriteKey)).booleanValue();
        File f = new File(to);

        if (f.exists() && !overwrite) {
            throw new CommandException("exception.file.exists", new String[] {
                to
            });
        }

        if (!f.exists()) {
View Full Code Here

        File f = new File(to);

        // check if the file exists
        if (f.exists() && !overwrite) {
            throw new CommandException("exception.file.exists", new String[] {
                to
            });
        }

        // export either a file or a folder
        if (node.isNodeType("nt:file")) {
            this.createFile(node, f);
        } else if (node.isNodeType("nt:folder")) {
            this.addFolder(node, f);
        } else {
            throw new CommandException("exception.not.file.or.folder",
                new String[] {
                    node.getPrimaryNodeType().getName()
                });
        }
View Full Code Here

            CommandException, ValueFormatException, PathNotFoundException,
            RepositoryException {

        boolean created = file.createNewFile();
        if (!created) {
            throw new CommandException("exception.file.not.created",
                new String[] {
                    file.getPath()
                });
        }
        BufferedOutputStream out = new BufferedOutputStream(
View Full Code Here

    private void addFolder(Node node, File file) throws CommandException,
            RepositoryException, IOException {
        boolean created = file.mkdir();

        if (!created) {
            throw new CommandException("exception.folder.not.created",
                new String[] {
                    file.getPath()
                });
        }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean execute(Context ctx) throws Exception {
        File f = new File((String) ctx.get(this.fileKey));
        if (!f.exists()) {
            throw new CommandException("exception.file.not.found",
                new String[] {
                    f.getAbsolutePath()
                });
        }
        // client
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.standalone.cli.CommandException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.