Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.GeoGIG.command()


        checkParameter(rootTreeId.isPresent(), "Couldn't resolve '" + refspec
                + "' to a treeish object");

        RevTree rootTree = geogig.getRepository().getTree(rootTreeId.get());
        Optional<NodeRef> featureTypeTree = geogig.command(FindTreeChild.class)
                .setChildPath(refspec.split(":")[1]).setParent(rootTree).setIndex(true).call();

        checkParameter(featureTypeTree.isPresent(), "pathspec '" + refspec.split(":")[1]
                + "' did not match any valid path");
View Full Code Here


            geogig = cli.newGeoGIG(Hints.readOnly());
        } catch (Exception e) {
            geogig = null;
        }
        if (geogig != null) {
            Optional<URL> dir = geogig.command(ResolveGeogigDir.class).call();
            if (dir.isPresent()) {
                try {
                    Optional<Ref> ref = geogig.command(RefParse.class).setName(Ref.HEAD).call();
                    if (ref.isPresent()) {
                        if (ref.get() instanceof SymRef) {
View Full Code Here

        }
        if (geogig != null) {
            Optional<URL> dir = geogig.command(ResolveGeogigDir.class).call();
            if (dir.isPresent()) {
                try {
                    Optional<Ref> ref = geogig.command(RefParse.class).setName(Ref.HEAD).call();
                    if (ref.isPresent()) {
                        if (ref.get() instanceof SymRef) {
                            currentHead = ((SymRef) ref.get()).getTarget();
                            int idx = currentHead.lastIndexOf("/");
                            if (idx != -1) {
View Full Code Here

            long changeCount = insertChanges(cli, changes, featureFilter);
            console.print(String.format("Applied %,d changes, staging...", changeCount));
            console.flush();
            ObjectId afterTreeId = workingTree.getTree().getId();

            DiffObjectCount diffCount = geogig.command(DiffCount.class)
                    .setOldVersion(workTreeId.toString()).setNewVersion(afterTreeId.toString())
                    .call();

            geogig.command(AddOp.class).call();
            console.println(String.format("done. %,d changes actually applied.",
View Full Code Here

            DiffObjectCount diffCount = geogig.command(DiffCount.class)
                    .setOldVersion(workTreeId.toString()).setNewVersion(afterTreeId.toString())
                    .call();

            geogig.command(AddOp.class).call();
            console.println(String.format("done. %,d changes actually applied.",
                    diffCount.featureCount()));
            console.flush();

            commit(cli, changeset);
View Full Code Here

        ConsoleReader console = cli.getConsole();
        console.print("Committing changeset " + changeset.getId() + "...");
        console.flush();

        GeoGIG geogig = cli.getGeogig();
        CommitOp command = geogig.command(CommitOp.class);
        command.setAllowEmpty(true);
        String message = "";
        if (changeset.getComment().isPresent()) {
            message = changeset.getComment().get() + "\nchangeset " + changeset.getId();
        } else {
View Full Code Here

        listener.setProgress(0f);
        listener.started();
        command.setProgressListener(listener);
        try {
            RevCommit commit = command.call();
            Ref head = geogig.command(RefParse.class).setName(Ref.HEAD).call().get();
            Preconditions.checkState(commit.getId().equals(head.getObjectId()));
            updateBranchChangeset(geogig, changeset.getId());
            listener.complete();
            console.println("Commit " + commit.getId().toString());
            console.flush();
View Full Code Here

    private void printRaw(GeogigCLI cli) throws IOException {
        ConsoleReader console = cli.getConsole();
        GeoGIG geogig = cli.getGeogig();
        for (String ref : refs) {
            Optional<RevObject> obj = geogig.command(RevObjectParse.class).setRefSpec(ref).call();
            if (!obj.isPresent()) {
                ref = getFullRef(ref);
                obj = geogig.command(RevObjectParse.class).setRefSpec(ref).call();
            }
            checkParameter(obj.isPresent(), "refspec did not resolve to any object.");
View Full Code Here

        GeoGIG geogig = cli.getGeogig();
        for (String ref : refs) {
            Optional<RevObject> obj = geogig.command(RevObjectParse.class).setRefSpec(ref).call();
            if (!obj.isPresent()) {
                ref = getFullRef(ref);
                obj = geogig.command(RevObjectParse.class).setRefSpec(ref).call();
            }
            checkParameter(obj.isPresent(), "refspec did not resolve to any object.");
            RevObject revObject = obj.get();
            if (revObject instanceof RevFeature) {
                Optional<RevFeatureType> opt = geogig.command(ResolveFeatureType.class)
View Full Code Here

                obj = geogig.command(RevObjectParse.class).setRefSpec(ref).call();
            }
            checkParameter(obj.isPresent(), "refspec did not resolve to any object.");
            RevObject revObject = obj.get();
            if (revObject instanceof RevFeature) {
                Optional<RevFeatureType> opt = geogig.command(ResolveFeatureType.class)
                        .setRefSpec(ref).call();
                if (opt.isPresent()) {
                    RevFeatureType ft = opt.get();
                    ImmutableList<PropertyDescriptor> attribs = ft.sortedDescriptors();
                    RevFeature feature = (RevFeature) revObject;
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.