Examples of workingTree()


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

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

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

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

    @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

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

        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

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

            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

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

        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

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

        }
        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

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

                .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

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

            String treePath = featureType.getName().getLocalPart();
            // check out the datastore branch on the transaction space
            final String branch = getOrFigureOutBranch();
            tx.command(CheckoutOp.class).setForce(true).setSource(branch).call();
            // now we can use the transaction working tree with the correct branch checked out
            WorkingTree workingTree = tx.workingTree();
            workingTree.createTypeTree(treePath, featureType);
            tx.command(AddOp.class).addPattern(treePath).call();
            tx.command(CommitOp.class).setMessage("Created feature type tree " + treePath).call();
            tx.commit();
        } catch (IllegalArgumentException alreadyExists) {
View Full Code Here

Examples of org.locationtech.geogig.repository.Repository.workingTree()

        GeoGIG geogig = geogigCLI.newGeoGIG(Hints.readWrite());
        Preconditions.checkNotNull(geogig);
        List<ObjectId> ids = Lists.newArrayListWithCapacity(features.length);
        try {
            Repository repository = geogig.getRepository();
            final WorkingTree workTree = repository.workingTree();
            for (Feature f : features) {
                Name name = f.getType().getName();
                String parentPath = name.getLocalPart();
                Node ref = workTree.insert(parentPath, f);
                ObjectId objectId = ref.getObjectId();
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.