/** * Constructs and returns a new read-write geogig facade, which will not be managed by this * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage * * @return the constructed GeoGIG. */ public GeoGIG newGeoGIG() { return newGeoGIG(Hints.readWrite()); }
/** * Constructs and returns a new read-write geogig facade, which will not be managed by this * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage * * @return the constructed GeoGIG. */ public GeoGIG newGeoGIG() { return newGeoGIG(Hints.readWrite()); }
/** * Constructs and returns a new read-write geogig facade, which will not be managed by this * GeogigCLI instance, so the calling code is responsible for closing/disposing it after usage * * @return the constructed GeoGIG. */ public GeoGIG newGeoGIG() { return newGeoGIG(Hints.readWrite()); }
@Nullable private GeoGIG loadRepository(Hints hints) { GeoGIG geogig = newGeoGIG(hints); if (geogig.command(ResolveGeogigURI.class).call().isPresent()) { Repository repository = geogig.getRepository(); if (repository != null) { return geogig; } } geogig.close(); return null; }
@Nullable private GeoGIG loadRepository(Hints hints) { GeoGIG geogig = newGeoGIG(hints); if (geogig.command(ResolveGeogigURI.class).call().isPresent()) { Repository repository = geogig.getRepository(); if (repository != null) { return geogig; } } geogig.close(); return null; }
@Nullable private GeoGIG loadRepository(Hints hints) { GeoGIG geogig = newGeoGIG(hints); if (geogig.command(ResolveGeogigURI.class).call().isPresent()) { Repository repository = geogig.getRepository(); if (repository != null) { return geogig; } } geogig.close(); return null; }
Repository loadGeoGIG(URI repo, GeogigCLI cli) { GeoGIG geogig = cli.newGeoGIG(new Hints().uri(repo)); if (geogig.command(ResolveGeogigURI.class).call().isPresent()) { geogig.getRepository(); } return geogig.getRepository(); } }
geogig = cli.newGeoGIG(Hints.readOnly()); closeIt = true;
@Given("^I have unstaged an empty feature type$") public void I_have_unstaged_an_empty_feature_type() throws Throwable { localRepo.insert(points1); GeoGIG geogig = localRepo.geogigCLI.newGeoGIG(); final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(pointsName, idP1); geogig.close(); }
@Given("^I have unstaged an empty feature type$") public void I_have_unstaged_an_empty_feature_type() throws Throwable { localRepo.insert(points1); GeoGIG geogig = localRepo.geogigCLI.newGeoGIG(); final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(pointsName, idP1); geogig.close(); }
@Given("^I have unstaged an empty feature type$") public void I_have_unstaged_an_empty_feature_type() throws Throwable { localRepo.insert(points1); GeoGIG geogig = localRepo.geogigCLI.newGeoGIG(); final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(pointsName, idP1); geogig.close(); }
public boolean delete(Feature f) throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); Name name = f.getType().getName(); String localPart = name.getLocalPart(); String id = f.getIdentifier().getID(); boolean existed = workTree.delete(localPart, id); return existed; } finally { geogig.close(); } }
public boolean delete(Feature f) throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); Name name = f.getType().getName(); String localPart = name.getLocalPart(); String id = f.getIdentifier().getID(); boolean existed = workTree.delete(localPart, id); return existed; } finally { geogig.close(); } }
public List<ObjectId> insert(Feature... features) throws Exception { geogigCLI.close(); GeoGIG geogig = geogigCLI.newGeoGIG(Hints.readWrite()); Preconditions.checkNotNull(geogig); List<ObjectId> ids = Lists.newArrayListWithCapacity(features.length);
public boolean delete(Feature f) throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); Name name = f.getType().getName(); String localPart = name.getLocalPart(); String id = f.getIdentifier().getID(); boolean existed = workTree.delete(localPart, id); return existed; } finally { geogig.close(); } }
/** * Executes the version command. * * @param cli * @see org.locationtech.geogig.cli.CLICommand#run(org.locationtech.geogig.cli.GeogigCLI) */ public void run(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); if (geogig == null) { geogig = cli.newGeoGIG(); } this.console = cli.getConsole(); VersionInfo info = geogig.command(VersionOp.class).call(); try { printVersionProperty("Project Version", info.getProjectVersion()); printVersionProperty("Build Time", info.getBuildTime()); printVersionProperty("Build User Name", info.getBuildUserName()); printVersionProperty("Build User Email", info.getBuildUserEmail()); printVersionProperty("Git Branch", info.getBranch()); printVersionProperty("Git Commit ID", info.getCommitId()); printVersionProperty("Git Commit Time", info.getCommitTime()); printVersionProperty("Git Commit Author Name", info.getCommitUserName()); printVersionProperty("Git Commit Author Email", info.getCommitUserEmail()); printVersionProperty("Git Commit Message", info.getCommitMessageFull()); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Executes the version command. * * @param cli * @see org.locationtech.geogig.cli.CLICommand#run(org.locationtech.geogig.cli.GeogigCLI) */ public void run(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); if (geogig == null) { geogig = cli.newGeoGIG(); } this.console = cli.getConsole(); VersionInfo info = geogig.command(VersionOp.class).call(); try { printVersionProperty("Project Version", info.getProjectVersion()); printVersionProperty("Build Time", info.getBuildTime()); printVersionProperty("Build User Name", info.getBuildUserName()); printVersionProperty("Build User Email", info.getBuildUserEmail()); printVersionProperty("Git Branch", info.getBranch()); printVersionProperty("Git Commit ID", info.getCommitId()); printVersionProperty("Git Commit Time", info.getCommitTime()); printVersionProperty("Git Commit Author Name", info.getCommitUserName()); printVersionProperty("Git Commit Author Email", info.getCommitUserEmail()); printVersionProperty("Git Commit Message", info.getCommitMessageFull()); } catch (IOException e) { Throwables.propagate(e); } }
public void deleteAndReplaceFeatureType() throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(points1.getType().getName().getLocalPart()); FeatureType newType = points1_FTmodified.getType(); Name name = newType.getName(); String parentPath = name.getLocalPart(); RevFeatureType rft = RevFeatureTypeBuilder.build(newType); geogig.getRepository().objectDatabase().put(rft); String path = NodeRef.appendChild(parentPath, points1_FTmodified.getIdentifier().getID()); FeatureInfo fi = FeatureInfo.insert(RevFeatureBuilder.build(points1_FTmodified), rft.getId(), path); workTree.insert(fi); } finally { geogig.close(); } }
public void deleteAndReplaceFeatureType() throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(points1.getType().getName().getLocalPart()); FeatureType newType = points1_FTmodified.getType(); Name name = newType.getName(); String parentPath = name.getLocalPart(); RevFeatureType rft = RevFeatureTypeBuilder.build(newType); geogig.getRepository().objectDatabase().put(rft); String path = NodeRef.appendChild(parentPath, points1_FTmodified.getIdentifier().getID()); FeatureInfo fi = FeatureInfo.insert(RevFeatureBuilder.build(points1_FTmodified), rft.getId(), path); workTree.insert(fi); } finally { geogig.close(); } }
public void deleteAndReplaceFeatureType() throws Exception { GeoGIG geogig = geogigCLI.newGeoGIG(); try { final WorkingTree workTree = geogig.getRepository().workingTree(); workTree.delete(points1.getType().getName().getLocalPart()); FeatureType newType = points1_FTmodified.getType(); Name name = newType.getName(); String parentPath = name.getLocalPart(); RevFeatureType rft = RevFeatureType.builder().type(newType).build(); geogig.getRepository().objectDatabase().put(rft); String path = NodeRef.appendChild(parentPath, points1_FTmodified.getIdentifier().getID()); FeatureInfo fi = FeatureInfo.insert(RevFeature.builder().build(points1_FTmodified), rft.getId(), path); workTree.insert(fi); } finally { geogig.close(); } }