Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.RemoveOp


            }
        }
        int featuresCount = pathsToRemove.size() - trees.size();

        /* Perform the remove operation */
        RemoveOp op = cli.getGeogig().command(RemoveOp.class);

        for (String pathToRemove : pathsToRemove) {
            op.addPathToRemove(pathToRemove);
        }

        op.setProgressListener(cli.getProgressListener()).call();

        /* And inform about it */
        if (featuresCount > 0) {
            console.print(String.format("Deleted %d feature(s)", featuresCount));
        }
View Full Code Here


        if (this.path == null) {
            throw new CommandSpecException("No path was specified for removal.");
        }

        final Context geogig = this.getCommandLocator(context);
        RemoveOp command = geogig.command(RemoveOp.class);

        NodeRef.checkValidPath(path);

        Optional<NodeRef> node = geogig.command(FindTreeChild.class)
                .setParent(geogig.workingTree().getTree()).setIndex(true).setChildPath(path)
                .call();
        if (node.isPresent()) {
            NodeRef nodeRef = node.get();
            if (nodeRef.getType() == TYPE.TREE) {
                if (!recursive) {
                    throw new CommandSpecException(
                            "Recursive option must be used to remove a tree.");
                }
            }
        }

        command.addPathToRemove(path).call();
        context.setResponseContent(new CommandResponse() {
            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start();
                out.writeElement("Deleted", path);
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.RemoveOp

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.