public FileBlobStore(final Platform platform) { Optional<URI> repoPath = new ResolveGeogigURI(platform, null).call(); Preconditions.checkState(repoPath.isPresent(), "Not inside a geogig directory"); URI uri = repoPath.get(); Preconditions.checkState("file".equals(uri.getScheme()), "Repository URL is not file system based: %s", uri); File repoLocation = new File(uri); this.repositoryDirectory = repoLocation; }
File getGeoGigDirectory() { final Optional<URI> repoUrl = new ResolveGeogigURI(platform, hints).call(); if (!repoUrl.isPresent()) { throw new IllegalStateException("Can't find geogig repository home"); } URI uri = repoUrl.get(); Preconditions.checkState("file".equals(uri.getScheme()), "Can't create BDB JE Environment on a non file repository URI: %s", uri); return new File(uri); }
public FileBlobStore(final Platform platform) { Optional<URI> repoPath = new ResolveGeogigURI(platform, null).call(); Preconditions.checkState(repoPath.isPresent(), "Not inside a geogig directory"); URI uri = repoPath.get(); Preconditions.checkState("file".equals(uri.getScheme()), "Repository URL is not file system based: %s", uri); File repoLocation = new File(uri); this.repositoryDirectory = repoLocation; }
public RocksdbObjectStore(Platform platform, @Nullable Hints hints, String databaseName) { checkNotNull(platform); this.platform = platform; this.hints = hints; Optional<URI> repoUriOpt = new ResolveGeogigURI(platform, hints).call(); checkArgument(repoUriOpt.isPresent(), "couldn't resolve geogig directory"); URI uri = repoUriOpt.get(); checkArgument("file".equals(uri.getScheme())); this.path = new File(new File(uri), databaseName).getAbsolutePath(); this.readOnly = hints == null ? false : hints.getBoolean(Hints.OBJECTS_READ_ONLY); }
@Inject public RocksdbGraphDatabase(Platform platform, Hints hints) { this.readOnly = hints == null ? false : hints.getBoolean(Hints.OBJECTS_READ_ONLY); Optional<URI> uri = new ResolveGeogigURI(platform, hints).call(); Preconditions.checkArgument(uri.isPresent(), "not in a geogig directory"); Preconditions.checkArgument("file".equals(uri.get().getScheme()), "Repository URI is not file://"); File basedir = new File(uri.get()); this.dbdir = new File(basedir, "graph.rocksdb"); }
public RocksdbObjectStore(Platform platform, @Nullable Hints hints, String databaseName) { checkNotNull(platform); this.platform = platform; this.hints = hints; Optional<URI> repoUriOpt = new ResolveGeogigURI(platform, hints).call(); checkArgument(repoUriOpt.isPresent(), "couldn't resolve geogig directory"); URI uri = repoUriOpt.get(); checkArgument("file".equals(uri.getScheme())); this.path = new File(new File(uri), databaseName).getAbsolutePath(); this.readOnly = hints == null ? false : hints.getBoolean(Hints.OBJECTS_READ_ONLY); }
@Inject public RocksdbGraphDatabase(Platform platform, Hints hints) { this.readOnly = hints == null ? false : hints.getBoolean(Hints.OBJECTS_READ_ONLY); Optional<URI> uri = new ResolveGeogigURI(platform, hints).call(); Preconditions.checkArgument(uri.isPresent(), "not in a geogig directory"); Preconditions.checkArgument("file".equals(uri.get().getScheme()), "Repository URI is not file://"); File basedir = new File(uri.get()); this.dbdir = new File(basedir, "graph.rocksdb"); }
private void resolveGeogigDir(Console console, GeoGIG geogig) throws IOException { URI repoUrl = geogig.command(ResolveGeogigURI.class).call().orNull(); if (null == repoUrl) { File currDir = geogig.getPlatform().pwd(); console.println("Error: not a geogig dir '" + currDir.getCanonicalFile().getAbsolutePath() + "'"); } else if ("file".equals(repoUrl.getScheme())) { console.println(new File(repoUrl).getCanonicalFile().getAbsolutePath()); } else { console.println(repoUrl.toString()); } }
@Override protected Boolean _call() { final Optional<URI> repoUrl = command(ResolveGeogigURI.class).call(); Boolean hasConflicts = Boolean.FALSE; if (repoUrl.isPresent()) { boolean conflicts = conflictsDatabase().hasConflicts(null); hasConflicts = Boolean.valueOf(conflicts); } return hasConflicts; } }
@Override protected Boolean _call() { final Optional<URI> repoUrl = command(ResolveGeogigURI.class).call(); Boolean hasConflicts = Boolean.FALSE; if (repoUrl.isPresent()) { boolean conflicts = conflictsDatabase().hasConflicts(null); hasConflicts = Boolean.valueOf(conflicts); } return hasConflicts; } }
private void resolveGeogigDir(Console console, GeoGIG geogig) throws IOException { URI repoUrl = geogig.command(ResolveGeogigURI.class).call().orNull(); if (null == repoUrl) { File currDir = geogig.getPlatform().pwd(); console.println("Error: not a geogig dir '" + currDir.getCanonicalFile().getAbsolutePath() + "'"); } else if ("file".equals(repoUrl.getScheme())) { console.println(new File(repoUrl).getCanonicalFile().getAbsolutePath()); } else { console.println(repoUrl.toString()); } }
private void resolveGeogigDir(Console console, GeoGIG geogig) throws IOException { URI repoUrl = geogig.command(ResolveGeogigURI.class).call().orNull(); if (null == repoUrl) { File currDir = geogig.getPlatform().pwd(); console.println("Error: not a geogig dir '" + currDir.getCanonicalFile().getAbsolutePath() + "'"); } else if ("file".equals(repoUrl.getScheme())) { console.println(new File(repoUrl).getCanonicalFile().getAbsolutePath()); } else { console.println(repoUrl.toString()); } }
private void isInsideWorkTree(Console console, GeoGIG geogig) throws IOException { Optional<URI> repoUrl = geogig.command(ResolveGeogigURI.class).call(); File pwd = geogig.getPlatform().pwd(); if (repoUrl.isPresent()) { boolean insideWorkTree = !pwd.getAbsolutePath().contains(".geogig"); console.println(String.valueOf(insideWorkTree)); } else { console.println("Error: not a geogig repository (or any parent) '" + pwd.getAbsolutePath() + "'"); } }
private void isInsideWorkTree(Console console, GeoGIG geogig) throws IOException { Optional<URI> repoUrl = geogig.command(ResolveGeogigURI.class).call(); File pwd = geogig.getPlatform().pwd(); if (repoUrl.isPresent()) { boolean insideWorkTree = !pwd.getAbsolutePath().contains(".geogig"); console.println(String.valueOf(insideWorkTree)); } else { console.println("Error: not a geogig repository (or any parent) '" + pwd.getAbsolutePath() + "'"); } }
@Override protected List<Conflict> _call() { final Optional<URI> repoUrl = command(ResolveGeogigURI.class).call(); if (repoUrl.isPresent()) { return conflictsDatabase().getConflicts(null, null); } else { return ImmutableList.of(); } }
private void isInsideWorkTree(Console console, GeoGIG geogig) throws IOException { Optional<URI> repoUrl = geogig.command(ResolveGeogigURI.class).call(); File pwd = geogig.getPlatform().pwd(); if (repoUrl.isPresent()) { boolean insideWorkTree = !pwd.getAbsolutePath().contains(".geogig"); console.println(String.valueOf(insideWorkTree)); } else { console.println("Error: not a geogig repository (or any parent) '" + pwd.getAbsolutePath() + "'"); } }
@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(); } }