public void PutFile() { string fullFileName = S3_DXW_ROOT + "/" + S3_FN1; S3V4URI fileUri = new S3V4URI(fullFileName); if (S3V4.FileExists(fileUri, S3_ACCESSKEY, S3_SECRETKEY, 0)) S3V4.RemoveFile(fileUri, S3_ACCESSKEY, S3_SECRETKEY, 0); S3V4.PutFile(fileUri, S3_ACCESSKEY, S3_SECRETKEY, S3_CONTENTSTREAM1, 0); using (MemoryStream ms = new MemoryStream()) { S3V4.GetFile(fileUri, S3_ACCESSKEY, S3_SECRETKEY, ms, 0); byte[] s3FileContentBytes = ms.GetBuffer(); string s3FileContentStr = Encoding.UTF8.GetString(s3FileContentBytes, 0, (int)ms.Length); Assert.AreEqual(S3_CONTENTSTR1, s3FileContentStr); } S3V4.RemoveFile(fileUri, S3_ACCESSKEY, S3_SECRETKEY, 0); }
public static void GetFile(S3V4URI uri, string accessKey, string secretKey, Stream stream, int timeoutMs) { GetFile(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, stream, timeoutMs); }
public static S3V4URI CreateFile(string path) { S3V4URI uri = new S3V4URI(path); return uri; }
public static S3V4URI CreateFolder(string path) { S3V4URI uri = new S3V4URI(path.ToDirectoryPath()); return uri; }
public S3V4FSH(S3V4URI uri) { Uri = uri; }
public static bool ItemExists(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return(ItemExists(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs)); }
public static void RemoveItem(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { RemoveItem(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs); }
public static string PutFile(S3V4URI uri, string accessKey, string secretKey, Stream contentStream, int timeoutMs) { return PutItem(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, contentStream, timeoutMs); }
public static string PutFolder(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return PutFolder( uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs); }
public static string ListBucket(S3V4URI uri, string accessKey, string secretKey, int timeoutMs, string prefix = null, string marker = null, int? maxKeys = null) { return ListBucket(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs, prefix, marker, maxKeys); }
public static S3V4URI CreateFile(string path) { S3V4URI uri = new S3V4URI(path); return(uri); }
public static S3V4URI CreateFolder(string path) { S3V4URI uri = new S3V4URI(path.ToDirectoryPath()); return(uri); }
public static string PutFolder(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return(PutFolder(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs)); }
public static bool FolderExists(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return FileExists(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs); }
public static string PutFile(S3V4URI uri, string accessKey, string secretKey, Stream contentStream, int timeoutMs) { return(PutItem(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, contentStream, timeoutMs)); }
public static string ListBucket(S3V4URI uri, string accessKey, string secretKey, int timeoutMs, string prefix = null, string marker = null, int?maxKeys = null) { return(ListBucket(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs, prefix, marker, maxKeys)); }
public static IDictionary<string, string> GetItemMetadata(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return GetItemMetadata(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs); }
public static IDictionary <string, string> GetItemMetadata(S3V4URI uri, string accessKey, string secretKey, int timeoutMs) { return(GetItemMetadata(uri.LocalPath, accessKey, secretKey, uri.Bucket, uri.Region, timeoutMs)); }