Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Context.workingTree()


        checkArgSpec(filterFileArg != null ^ bboxArg != null || update,
                "You must specify a filter file or a bounding box");
        checkArgSpec((filterFileArg != null || bboxArg != null) ^ update,
                "Filters cannot be used when updating");

        checkArgSpec(context.index().isClean() && context.workingTree().isClean(),
                "Working tree and index are not clean");

        checkArgSpec(!rebase || update, "rebase switch can only be used when updating");

        final File filterFile = parseFile(filterFileArg);
View Full Code Here


    /**
     * @return
     */
    WorkingTree getWorkingTree() {
        Context commandLocator = getCommandLocator();
        WorkingTree workingTree = commandLocator.workingTree();
        return workingTree;
    }
}
View Full Code Here

    @Test
    public void testDeleteException() throws Exception {
        WorkingTree workTree = mock(WorkingTree.class);
        Context cmdl = mock(Context.class);
        when(cmdl.workingTree()).thenReturn(workTree);
        doThrow(new RuntimeException("Exception")).when(workTree).delete(any(String.class));
        ImportOp importOp = new ImportOp();
        importOp.setContext(cmdl);
        importOp.setDataStore(TestHelper.createTestFactory().createDataStore(null));
        importOp.setAll(true);
View Full Code Here

        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) {
View Full Code Here

            throw new CommandSpecException(
                    "No transaction was specified, add requires a transaction to preserve the stability of the repository.");
        }
        final Context geogig = this.getCommandLocator(context);

        RevTree revTree = geogig.workingTree().getTree();

        Optional<NodeRef> nodeRef = geogig.command(FindTreeChild.class).setParent(revTree)
                .setChildPath(NodeRef.parentPath(path)).setIndex(true).call();
        Preconditions.checkArgument(nodeRef.isPresent(), "Invalid reference: %s",
                NodeRef.parentPath(path));
View Full Code Here

        NodeRef node = new NodeRef(Node.create(NodeRef.nodeFromPath(path), objectId, ObjectId.NULL,
                TYPE.FEATURE, bounds), NodeRef.parentPath(path), ObjectId.NULL);

        Optional<NodeRef> parentNode = geogig.command(FindTreeChild.class)
                .setParent(geogig.workingTree().getTree()).setChildPath(node.getParentPath())
                .setIndex(true).call();
        RevTreeBuilder treeBuilder = null;
        ObjectId metadataId = ObjectId.NULL;
        if (parentNode.isPresent()) {
            metadataId = parentNode.get().getMetadataId();
View Full Code Here

        }
        treeBuilder.put(node.getNode());
        ObjectId newTreeId = geogig
                .command(WriteBack.class)
                .setAncestor(
                        geogig.workingTree().getTree().builder(geogig.stagingDatabase()))
                .setChildPath(node.getParentPath()).setToIndex(true).setTree(treeBuilder.build())
                .setMetadataId(metadataId).call();
        geogig.workingTree().updateWorkHead(newTreeId);

        AddOp command = geogig.command(AddOp.class);
View Full Code Here

                .command(WriteBack.class)
                .setAncestor(
                        geogig.workingTree().getTree().builder(geogig.stagingDatabase()))
                .setChildPath(node.getParentPath()).setToIndex(true).setTree(treeBuilder.build())
                .setMetadataId(metadataId).call();
        geogig.workingTree().updateWorkHead(newTreeId);

        AddOp command = geogig.command(AddOp.class);

        command.addPattern(path);
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.