Package org.apache.jackrabbit.vault.util.console

Examples of org.apache.jackrabbit.vault.util.console.ConsoleFile.unwrap()


        String jcrPath = (String) cl.getValue(argJcrPath);
        String name = (String) cl.getValue(argLocalPath);

        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof VaultFsCFile) {
            VaultFile file = (VaultFile) wo.unwrap();
            if (name == null) {
                name = file.getName();
            }
            File local = ctx.getVaultFsApp().getPlatformFile(name, false);
            doGet(file, local, forced);
View Full Code Here


                throw new ExecutionException("getRelated. needs path argument.");
            }
            String path = (String) args.get(0);
            ConsoleFile wo = ctx.getFile(path, true);
            if (wo instanceof VaultFsCFile) {
                VaultFile file = (VaultFile) wo.unwrap();
                Collection<? extends VaultFile> related = file.getRelated();
                if (related == null) {
                    System.out.println("(null)");                   
                } else {
                    for (VaultFile f: related) {
View Full Code Here

                throw new ExecutionException("test. needs path argument.");
            }
            String path = (String) args.get(0);
            ConsoleFile wo = ctx.getFile(path, true);
            if (wo instanceof PlatformFile) {
                File file = (File) wo.unwrap();
                DefaultWorkspaceFilter r = new DefaultWorkspaceFilter();
                try {
                    r.load(file);
                    DumpContext dCtx = new DumpContext(new PrintWriter(System.out));
                    r.dump(dCtx, false);
View Full Code Here

    protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception {
        String jcrPath = (String) cl.getValue(argJcrPath);

        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof VaultFsCFile) {
            VaultFile file = (VaultFile) wo.unwrap();
            file.invalidate();
        } else {
            throw new ExecutionException("'cat' only possible in jcr fs context");
        }
    }
View Full Code Here

        List added = cl.getValues(optAdd);
        List rems = cl.getValues(optRemove);

        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof RepositoryCFile) {
            Node node = (Node) wo.unwrap();
            try {
                for (Iterator it = added.iterator(); it.hasNext();) {
                    node.addMixin((String) it.next());
                }
                for (Iterator it = rems.iterator(); it.hasNext();) {
View Full Code Here

    protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception {
        String path = (String) cl.getValue(argPath);
        boolean recursive = cl.hasOption(optRecursive);
        ConsoleFile file = ctx.getFile(path, true);
        if (file instanceof AggregateCFile) {
            AggregateImpl node = (AggregateImpl) file.unwrap();
            node.remove(recursive);
        } else {
            throw new ExecutionException("remove only allowed in afct mode.");
        }
    }
View Full Code Here

            if (cl.hasOption(optConfig) || cl.hasOption(optFilter)) {
                ConsoleFile f = ctx.getCurrentFile();
                File file;
                if (f instanceof PlatformFile) {
                    f = f.getFile(path, false);
                    file = (File) f.unwrap();
                } else {
                    file = ctx.getVaultFsApp().getPlatformFile(path, false);
                }
                if (cl.hasOption(optConfig)) {
                    IOUtils.copy(
View Full Code Here

        if (jcrPath == null) {
            jcrPath = "/";
        }
        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof RepositoryCFile) {
            Node node = (Node) wo.unwrap();
            try {
                node.refresh(cl.hasOption(optKeepChanges));
                System.out.println("Modifications refreshed.");
            } catch (RepositoryException e) {
                throw new ExecutionException("Error while refreshing: " + e);
View Full Code Here

    protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception {
        String jcrPath = (String) cl.getValue(argJcrPath);

        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof VaultFsCFile) {
            VaultFile file = (VaultFile) wo.unwrap();
            try {
                String ct = file.getContentType();
                if (ct == null) {
                    ct = "application/octet-stream";
                }
View Full Code Here

        if (jcrPath == null) {
            jcrPath = "/";
        }
        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof RepositoryCFile) {
            Node node = (Node) wo.unwrap();
            try {
                node.save();
                System.out.println("Modifications persisted.");
            } catch (RepositoryException e) {
                throw new ExecutionException("Error while saving: " + e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.