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)); }
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)))); }
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))))); }
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); }
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); }
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)); }
private ISleetFile CreateAmazonS3File(SleetUriPair pair) { var key = GetRelativePath(pair.Root); return(new AmazonS3File(this, pair.Root, pair.BaseURI, LocalCache.GetNewTempPath(), client, bucketName, key)); }