fix: instantiate separate idCache for each PCloud instance
This commit is contained in:
parent
d3bb9d30aa
commit
6ccee05851
@ -28,8 +28,8 @@ class PCloudContentRepository extends InterceptingCloudContentRepository<PCloud,
|
||||
|
||||
private final PCloud cloud;
|
||||
|
||||
public PCloudContentRepository(PCloud cloud, Context context, PCloudIdCache idCache) {
|
||||
super(new Intercepted(cloud, context, idCache));
|
||||
public PCloudContentRepository(PCloud cloud, Context context) {
|
||||
super(new Intercepted(cloud, context));
|
||||
this.cloud = cloud;
|
||||
}
|
||||
|
||||
@ -59,8 +59,8 @@ class PCloudContentRepository extends InterceptingCloudContentRepository<PCloud,
|
||||
|
||||
private final PCloudImpl cloud;
|
||||
|
||||
public Intercepted(PCloud cloud, Context context, PCloudIdCache idCache) {
|
||||
this.cloud = new PCloudImpl(context, cloud, idCache);
|
||||
public Intercepted(PCloud cloud, Context context) {
|
||||
this.cloud = new PCloudImpl(context, cloud);
|
||||
}
|
||||
|
||||
public PCloudFolder root(PCloud cloud) {
|
||||
|
@ -16,12 +16,10 @@ import static org.cryptomator.domain.CloudType.PCLOUD;
|
||||
public class PCloudContentRepositoryFactory implements CloudContentRepositoryFactory {
|
||||
|
||||
private final Context context;
|
||||
private final PCloudIdCache idCache;
|
||||
|
||||
@Inject
|
||||
public PCloudContentRepositoryFactory(Context context, PCloudIdCache idCache) {
|
||||
public PCloudContentRepositoryFactory(Context context) {
|
||||
this.context = context;
|
||||
this.idCache = idCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -31,7 +29,7 @@ public class PCloudContentRepositoryFactory implements CloudContentRepositoryFac
|
||||
|
||||
@Override
|
||||
public CloudContentRepository cloudContentRepositoryFor(Cloud cloud) {
|
||||
return new PCloudContentRepository((PCloud) cloud, context, idCache);
|
||||
return new PCloudContentRepository((PCloud) cloud, context);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -70,14 +70,14 @@ class PCloudImpl {
|
||||
|
||||
private final String UTF_8 = "UTF-8";
|
||||
|
||||
PCloudImpl(Context context, PCloud cloud, PCloudIdCache idCache) {
|
||||
PCloudImpl(Context context, PCloud cloud) {
|
||||
if (cloud.accessToken() == null) {
|
||||
throw new NoAuthenticationProvidedException(cloud);
|
||||
}
|
||||
|
||||
this.context = context;
|
||||
this.cloud = cloud;
|
||||
this.idCache = idCache;
|
||||
this.idCache = new PCloudIdCache();
|
||||
this.root = new RootPCloudFolder(cloud);
|
||||
this.sharedPreferencesHandler = new SharedPreferencesHandler(context);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user