feat(Data): introduce PCloudCloudContentRepositoryFactory

This commit is contained in:
Manuel Jenny 2021-03-12 16:05:13 +01:00
parent 32ce52c93d
commit 9329062b54
No known key found for this signature in database
GPG Key ID: 1C80FE62B2BEAA18

View File

@ -0,0 +1,35 @@
package org.cryptomator.data.cloud.pcloud;
import android.content.Context;
import org.cryptomator.data.repository.CloudContentRepositoryFactory;
import org.cryptomator.domain.Cloud;
import org.cryptomator.domain.PCloudCloud;
import org.cryptomator.domain.repository.CloudContentRepository;
import javax.inject.Inject;
import javax.inject.Singleton;
import static org.cryptomator.domain.CloudType.PCLOUD;
@Singleton
public class PCloudCloudContentRepositoryFactory implements CloudContentRepositoryFactory {
private final Context context;
@Inject
public PCloudCloudContentRepositoryFactory(Context context) {
this.context = context;
}
@Override
public boolean supports(Cloud cloud) {
return cloud.type() == PCLOUD;
}
@Override
public CloudContentRepository cloudContentRepositoryFor(Cloud cloud) {
return new PCloudCloudContentRepository((PCloudCloud) cloud, context);
}
}