package modules.storage;

import com.google.inject.AbstractModule;
import play.Configuration;
import play.Environment;

public class StorageModule extends AbstractModule {
    private final Environment environment;
    private final Configuration configuration;

    public StorageModule(Environment environment, Configuration configuration) {
        this.environment = environment;
        this.configuration = configuration;
    }

    @Override
    protected void configure() {
        String storageType = configuration.getString("storage.type", "mock");

        switch (storageType) {
            case "mock" :
                bind (Storage.class).to(MockStorage.class);
                break;
            case "local" :
                bind (Storage.class).to(LocalFilesystemStorage.class);
                break;
            case "s3" :
                bind (Storage.class).to(AmazonS3Storage.class);
                break;
        }
    }
}

@@ -545,20 +545,21 @@
 type%22, %22
-mock
+local
 %22);%0A%0A   

Set local storage as default storage type