Ejemplo n.º 1
0
 public CachingFileStorage(IFileStorage cachedStorage, string cacheDir, ICacheSupervisor cacheSupervisor)
 {
     _cachedStorage   = new OfflineSwitchableFileStorage(cachedStorage);
     _cacheSupervisor = cacheSupervisor;
     _streamCacheDir  = cacheDir + Java.IO.File.Separator + "OfflineCache" + Java.IO.File.Separator;
     if (!Directory.Exists(_streamCacheDir))
     {
         Directory.CreateDirectory(_streamCacheDir);
     }
 }
Ejemplo n.º 2
0
        public CachingFileStorage(IFileStorage cachedStorage, Context cacheDirContext, ICacheSupervisor cacheSupervisor)
        {
            _cachedStorage   = new OfflineSwitchableFileStorage(cachedStorage);
            _cacheSupervisor = cacheSupervisor;
            _legacyCacheDir  = cacheDirContext.CacheDir.Path + Java.IO.File.Separator + "OfflineCache" + Java.IO.File.Separator;
            if (!Directory.Exists(_legacyCacheDir))
            {
                Directory.CreateDirectory(_legacyCacheDir);
            }

            _cacheDir = IoUtil.GetInternalDirectory(cacheDirContext).Path + Java.IO.File.Separator + "OfflineCache" + Java.IO.File.Separator;
            if (!Directory.Exists(_cacheDir))
            {
                Directory.CreateDirectory(_cacheDir);
            }
        }