Пример #1
0
        private ISleetFile CreateAmazonS3File(Uri uri)
        {
            Uri    rootUri = UriUtility.ChangeRoot(BaseURI, Root, uri);
            string key     = GetPathRelativeToBucket(uri);

            return(new AmazonS3File(this, rootUri, uri, LocalCache.GetNewTempPath(), client, bucketName, key));
        }
Пример #2
0
 public override ISleetFile Get(Uri path)
 {
     return(GetOrAddFile(path, caseSensitive: false,
                         createFile: (pair) => new PhysicalFile(
                             this,
                             pair.Root,
                             pair.BaseURI,
                             LocalCache.GetNewTempPath(),
                             new FileInfo(pair.Root.LocalPath))));
 }
Пример #3
0
 public override ISleetFile Get(Uri path)
 {
     return(GetOrAddFile(path, caseSensitive: true,
                         createFile: (pair) => new AzureFile(
                             this,
                             pair.Root,
                             pair.BaseURI,
                             LocalCache.GetNewTempPath(),
                             _container.GetBlockBlobReference(GetRelativePath(path)))));
 }
Пример #4
0
        public ISleetFile Get(Uri path)
        {
            var relativePath = GetRelativePath(path);

            var blob = _container.GetBlockBlobReference(relativePath);

            var file = Files.GetOrAdd(path, (uri) =>
            {
                var rootUri = UriUtility.ChangeRoot(_baseUri, _root, uri);

                return(new AzureFile(
                           this,
                           rootUri,
                           uri,
                           LocalCache.GetNewTempPath(),
                           blob));
            });

            return(file);
        }
Пример #5
0
        public ISleetFile Get(Uri path)
        {
            if (path == null)
            {
                Debug.Fail("bad path");
                throw new ArgumentNullException(nameof(path));
            }

            if (!path.AbsoluteUri.StartsWith(BaseURI.AbsoluteUri))
            {
                throw new ArgumentException(string.Format("Base uri does not match the file system. Url: {0}, Expecting: {1}", path.AbsoluteUri, BaseURI.AbsoluteUri));
            }

            var file = Files.GetOrAdd(path, (uri) =>
            {
                var rootUri    = uri;
                var displayUri = uri;

                if (!UriUtility.HasRoot(Root, rootUri))
                {
                    rootUri = UriUtility.ChangeRoot(BaseURI, Root, uri);
                }

                if (!UriUtility.HasRoot(BaseURI, displayUri))
                {
                    displayUri = UriUtility.ChangeRoot(Root, BaseURI, uri);
                }

                return(new PhysicalFile(
                           this,
                           rootUri,
                           displayUri,
                           LocalCache.GetNewTempPath(),
                           new FileInfo(rootUri.LocalPath)));
            });

            return(file);
        }
Пример #6
0
        private ISleetFile CreateAmazonS3File(SleetUriPair pair)
        {
            var key = GetRelativePath(pair.Root);

            return(new AmazonS3File(this, pair.Root, pair.BaseURI, LocalCache.GetNewTempPath(), _client, _bucketName, key, _serverSideEncryptionMethod, _compress));
        }
Пример #7
0
        private ISleetFile CreateAmazonS3File(SleetUriPair pair)
        {
            var key = GetRelativePath(pair.Root);

            return(new AmazonS3File(this, pair.Root, pair.BaseURI, LocalCache.GetNewTempPath(), client, bucketName, key));
        }