2019-09-15 14:16:32 +02:00
|
|
|
import { Launcher } from 'comp/launcher';
|
|
|
|
import { StorageCache } from 'storage/impl/storage-cache';
|
|
|
|
import { StorageDropbox } from 'storage/impl/storage-dropbox';
|
|
|
|
import { StorageFile } from 'storage/impl/storage-file';
|
|
|
|
import { StorageFileCache } from 'storage/impl/storage-file-cache';
|
|
|
|
import { StorageGDrive } from 'storage/impl/storage-gdrive';
|
|
|
|
import { StorageOneDrive } from 'storage/impl/storage-onedrive';
|
|
|
|
import { StorageWebDav } from 'storage/impl/storage-webdav';
|
2015-12-06 21:32:41 +01:00
|
|
|
|
2017-02-20 23:38:52 +01:00
|
|
|
const BuiltInStorage = {
|
2019-09-15 13:24:53 +02:00
|
|
|
file: new StorageFile(),
|
|
|
|
cache: Launcher ? new StorageFileCache() : new StorageCache()
|
2017-02-04 19:31:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const ThirdPartyStorage = {
|
2019-09-15 13:24:53 +02:00
|
|
|
dropbox: new StorageDropbox(),
|
|
|
|
gdrive: new StorageGDrive(),
|
|
|
|
onedrive: new StorageOneDrive(),
|
|
|
|
webdav: new StorageWebDav()
|
2015-12-02 21:39:40 +01:00
|
|
|
};
|
|
|
|
|
2019-09-15 14:16:32 +02:00
|
|
|
const Storage = BuiltInStorage;
|
2017-04-14 23:22:33 +02:00
|
|
|
if (!Launcher || Launcher.thirdPartyStoragesSupported) {
|
2019-09-15 14:16:32 +02:00
|
|
|
_.extend(Storage, ThirdPartyStorage);
|
2017-02-22 01:35:16 +01:00
|
|
|
}
|
|
|
|
|
2019-09-15 14:16:32 +02:00
|
|
|
export { Storage };
|