Package org.locationtech.geogig.api.plumbing

Examples of org.locationtech.geogig.api.plumbing.ResolveGeogigDir


    @Override
    public Map<String, String> getAll(String namespace) {
        Preconditions.checkNotNull(namespace);
        File refsRoot;
        try {
            Optional<URL> envHome = new ResolveGeogigDir(platform).call();
            refsRoot = new File(envHome.get().toURI());
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        if (namespace.endsWith("/")) {
View Full Code Here


        RepositoryConnectionException.StorageType.REF.verify(configDB, "file", "1.0");
    }

    @Override
    public String toString() {
        Optional<URL> envHome = new ResolveGeogigDir(platform).call();
        return String.format("%s[geogig dir: %s]", getClass().getSimpleName(), envHome.orNull());
    }
View Full Code Here

    @Override
    public void open() {
        if (isOpen()) {
            return;
        }
        final Optional<URL> repoUrl = new ResolveGeogigDir(platform).call();
        checkState(repoUrl.isPresent(), "Can't find geogig repository home");

        try {
            dataRoot = new File(new File(repoUrl.get().toURI()), databaseName);
        } catch (URISyntaxException e) {
View Full Code Here

    @Inject
    public IniFileConfigDatabase(final Platform platform) {
        this.local = new INIFile() {
            @Override
            public File iniFile() {
                final Optional<URL> url = new ResolveGeogigDir(platform).call();

                if (!url.isPresent()) {
                    throw new ConfigException(StatusCode.INVALID_LOCATION);
                }
View Full Code Here

        put(entry, (String) (value != null ? value.toString() : null), config);
    }

    Config local() {
        if (local == null || !lastWorkingDir.equals(platform.pwd())) {
            final Optional<URL> url = new ResolveGeogigDir(platform).call();

            if (!url.isPresent()) {
                throw new ConfigException(StatusCode.INVALID_LOCATION);
            }
View Full Code Here

    /**
     * Returns the .geogig directory for the platform object.
     */
    public static File geogigDir(Platform platform) {
        Optional<URL> url = new ResolveGeogigDir(platform).call();
        if (!url.isPresent()) {
            throw new RuntimeException("Unable to resolve .geogig directory");
        }
        try {
            return new File(url.get().toURI());
View Full Code Here

    }

    static void tryConfigureLogging(Platform platform) {
        // instantiate and call ResolveGeogigDir directly to avoid calling getGeogig() and hence get
        // some logging events before having configured logging
        final Optional<URL> geogigDirUrl = new ResolveGeogigDir(platform).call();
        if (!geogigDirUrl.isPresent() || !"file".equalsIgnoreCase(geogigDirUrl.get().getProtocol())) {
            // redirect java.util.logging to SLF4J anyways
            SLF4JBridgeHandler.removeHandlersForRootLogger();
            SLF4JBridgeHandler.install();
            return;
View Full Code Here

    }

    @Override
    public void open() {
        super.open();
        Optional<URL> repoPath = new ResolveGeogigDir(platform).call();
        try {
            File repoLocation = new File(repoPath.get().toURI());
            this.repositoryDirectory = repoLocation;
        } catch (URISyntaxException e1) {
            Throwables.propagate(e1);
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.plumbing.ResolveGeogigDir

Copyright © 2018 www.massapicom. 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.