/*
 */
package org.datadryad.rest.storage.resolvers;

import org.datadryad.rest.storage.rdbms.DatabaseOrganizationStorageImpl;
import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
import java.io.File;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;
import org.datadryad.rest.storage.AbstractOrganizationStorage;
import org.datadryad.rest.storage.json.OrganizationJSONStorageImpl;

/**
 *
 * @author Dan Leehr <dan.leehr@nescent.org>
 */
@Provider
public class OrganizationStorageResolver extends SingletonTypeInjectableProvider<Context, AbstractOrganizationStorage> {
    private static final String PATH = "/tmp/dryad_rest";
    public OrganizationStorageResolver() {
        super(AbstractOrganizationStorage.class, new OrganizationJSONStorageImpl(new File(PATH)));
        File directory = new File(PATH);
        if(!directory.exists()) {
            directory.mkdir();
        }
    }
}

/*
 */
package org.datadryad.rest.storage.resolvers;

import org.datadryad.rest.storage.rdbms.DatabaseOrganizationStorageImpl;
import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
import javax.ws.rs.core.Context;
import javax.ws.rs.ext.Provider;
import org.datadryad.rest.storage.AbstractOrganizationStorage;

/**
 *
 * @author Dan Leehr <dan.leehr@nescent.org>
 */
@Provider
public class OrganizationStorageResolver extends SingletonTypeInjectableProvider<Context, AbstractOrganizationStorage> {
    public OrganizationStorageResolver() {
        super(AbstractOrganizationStorage.class, new DatabaseOrganizationStorageImpl("/opt/dryad/config/dspace.cfg"));
    }
}

Revert "Switched organization storage back to JSON"
Revert "Switched organization storage back to JSON"

This reverts commit 0a1fcfbea514419bd72bfda0c37cd57479e1b491.
