C# Класс Amazon.S3.IO.S3FileInfo

Mimics the System.IO.FileInfo for a file in S3. It exposes properties and methods manipulating files in S3.
Наследование: IS3FileSystemInfo
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ExistsWithBucketCheck bool
SameClient bool

Открытые методы

Метод Описание
CopyFromLocal ( string srcFileName ) : S3FileInfo

Copies the file from the local file system to S3. If the file already exists in S3 than an ArgumentException is thrown.

CopyFromLocal ( string srcFileName, bool overwrite ) : S3FileInfo

Copies the file from the local file system to S3. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.

CopyTo ( S3DirectoryInfo dir ) : S3FileInfo

Copies this file to the target directory. If the file already exists in S3 than an ArgumentException is thrown.

CopyTo ( S3DirectoryInfo dir, bool overwrite ) : S3FileInfo

Copies this file to the target directory. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.

CopyTo ( S3FileInfo file ) : S3FileInfo

Copies this file to the location indicated by the passed in S3FileInfo. If the file already exists in S3 than an ArgumentException is thrown.

CopyTo ( S3FileInfo file, bool overwrite ) : S3FileInfo

Copies this file to the location indicated by the passed in S3FileInfo. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.

CopyTo ( string newBucket, string newKey ) : S3FileInfo

Copies this file's content to the file indicated by the S3 bucket and object key. If the file already exists in S3 than an ArgumentException is thrown.

CopyTo ( string newBucket, string newKey, bool overwrite ) : S3FileInfo

Copies this file's content to the file indicated by the S3 bucket and object key. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.

CopyToLocal ( string destFileName ) : FileInfo

Copies from S3 to the local file system. If the file already exists on the local file system than an ArgumentException is thrown.

CopyToLocal ( string destFileName, bool overwrite ) : FileInfo

Copies from S3 to the local file system. If the file already exists on the local file system and overwrite is set to false than an ArgumentException is thrown.

Create ( ) : Stream

Returns a Stream that can be used to write data to S3. The content is persisted to S3 once the Stream is closed.

CreateText ( ) : StreamWriter

Returns a StreamWriter that can be used to write data to S3. The content is persisted to S3 once the StreamWriter is closed.

Delete ( ) : void

Deletes the from S3.

MoveFromLocal ( string path ) : S3FileInfo

Moves the file from the local file system to S3 in this directory. If the file already exists in S3 than an ArgumentException is thrown.

MoveFromLocal ( string path, bool overwrite ) : S3FileInfo

Moves the file from the local file system to S3 in this directory. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.

MoveTo ( S3DirectoryInfo path ) : S3FileInfo

Moves the file to a a new location in S3.

MoveTo ( S3FileInfo file ) : S3FileInfo

Moves the file to a a new location in S3.

MoveTo ( string bucket, string key ) : S3FileInfo

Moves the file to a a new location in S3.

MoveToLocal ( string path ) : FileInfo

Moves the file from S3 to the local file system in the location indicated by the path parameter.

OpenRead ( ) : Stream

Returns a Stream for reading the contents of the file.

OpenText ( ) : StreamReader

Returns a StreamReader for reading the contents of the file.

OpenWrite ( ) : Stream

Returns a Stream for writing to S3. If the file already exists it will be overwritten.

Replace ( S3DirectoryInfo destDir, S3DirectoryInfo backupDir ) : S3FileInfo

Replaces the destination file with the content of this file and then deletes the orignial file. If a backupDir is specifed then the content of destination file is backup to it.

Replace ( S3FileInfo destFile, S3FileInfo backupFile ) : S3FileInfo

Replaces the destination file with the content of this file and then deletes the orignial file. If a backupFile is specifed then the content of destination file is backup to it.

Replace ( string destinationBucket, string destinationKey, string backupBucket, string backupKey ) : S3FileInfo

Replaces the destination file with the content of this file and then deletes the orignial file. If a backup location is specifed then the content of destination file is backup to it.

ReplaceLocal ( string destinationFileName, string destinationBackupFileName ) : FileInfo

Replaces the content of the destination file on the local file system with the content from this file from S3. If a backup file is specified then the content of the destination file is backup to it.

S3FileInfo ( IAmazonS3 s3Client, string bucket, string key ) : System

Initialize a new instance of the S3FileInfo class for the specified S3 bucket and S3 object key.

ToString ( ) : string

Приватные методы

Метод Описание
ExistsWithBucketCheck ( bool &bucketExists ) : bool
SameClient ( S3FileInfo otherFile ) : bool

Описание методов

CopyFromLocal() публичный Метод

Copies the file from the local file system to S3. If the file already exists in S3 than an ArgumentException is thrown.
If the file already exists in S3.
public CopyFromLocal ( string srcFileName ) : S3FileInfo
srcFileName string Location of the file on the local file system to copy.
Результат S3FileInfo

CopyFromLocal() публичный Метод

Copies the file from the local file system to S3. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.
If the file already exists in S3 and overwrite is set to false.
public CopyFromLocal ( string srcFileName, bool overwrite ) : S3FileInfo
srcFileName string Location of the file on the local file system to copy.
overwrite bool Determines whether the file can be overwritten.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file to the target directory. If the file already exists in S3 than an ArgumentException is thrown.
If the directory does not exist. If the file already exists in S3.
public CopyTo ( S3DirectoryInfo dir ) : S3FileInfo
dir S3DirectoryInfo Target directory where to copy the file to.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file to the target directory. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.
If the directory does not exist. If the file already exists in S3 and overwrite is set to false.
public CopyTo ( S3DirectoryInfo dir, bool overwrite ) : S3FileInfo
dir S3DirectoryInfo Target directory where to copy the file to.
overwrite bool Determines whether the file can be overwritten.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file to the location indicated by the passed in S3FileInfo. If the file already exists in S3 than an ArgumentException is thrown.
If the file already exists in S3.
public CopyTo ( S3FileInfo file ) : S3FileInfo
file S3FileInfo The target location to copy this file to.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file to the location indicated by the passed in S3FileInfo. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.
If the file already exists in S3 and overwrite is set to false.
public CopyTo ( S3FileInfo file, bool overwrite ) : S3FileInfo
file S3FileInfo The target location to copy this file to.
overwrite bool Determines whether the file can be overwritten.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file's content to the file indicated by the S3 bucket and object key. If the file already exists in S3 than an ArgumentException is thrown.
public CopyTo ( string newBucket, string newKey ) : S3FileInfo
newBucket string S3 bucket to copy the file to.
newKey string S3 object key to copy the file to.
Результат S3FileInfo

CopyTo() публичный Метод

Copies this file's content to the file indicated by the S3 bucket and object key. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.
If the file already exists in S3 and overwrite is set to false.
public CopyTo ( string newBucket, string newKey, bool overwrite ) : S3FileInfo
newBucket string S3 bucket to copy the file to.
newKey string S3 object key to copy the file to.
overwrite bool Determines whether the file can be overwritten.
Результат S3FileInfo

CopyToLocal() публичный Метод

Copies from S3 to the local file system. If the file already exists on the local file system than an ArgumentException is thrown.
If the file already exists locally.
public CopyToLocal ( string destFileName ) : FileInfo
destFileName string The path where to copy the file to.
Результат System.IO.FileInfo

CopyToLocal() публичный Метод

Copies from S3 to the local file system. If the file already exists on the local file system and overwrite is set to false than an ArgumentException is thrown.
If the file already exists locally and overwrite is set to false.
public CopyToLocal ( string destFileName, bool overwrite ) : FileInfo
destFileName string The path where to copy the file to.
overwrite bool Determines whether the file can be overwritten.
Результат System.IO.FileInfo

Create() публичный Метод

Returns a Stream that can be used to write data to S3. The content is persisted to S3 once the Stream is closed.
public Create ( ) : Stream
Результат Stream

CreateText() публичный Метод

Returns a StreamWriter that can be used to write data to S3. The content is persisted to S3 once the StreamWriter is closed.
public CreateText ( ) : StreamWriter
Результат System.IO.StreamWriter

Delete() публичный Метод

Deletes the from S3.
public Delete ( ) : void
Результат void

MoveFromLocal() публичный Метод

Moves the file from the local file system to S3 in this directory. If the file already exists in S3 than an ArgumentException is thrown.
If the file already exists locally.
public MoveFromLocal ( string path ) : S3FileInfo
path string The local file system path where the files are to be moved.
Результат S3FileInfo

MoveFromLocal() публичный Метод

Moves the file from the local file system to S3 in this directory. If the file already exists in S3 and overwrite is set to false than an ArgumentException is thrown.
If the file already exists in S3 and overwrite is set to false.
public MoveFromLocal ( string path, bool overwrite ) : S3FileInfo
path string The local file system path where the files are to be moved.
overwrite bool Determines whether the file can be overwritten.
Результат S3FileInfo

MoveTo() публичный Метод

Moves the file to a a new location in S3.
If the file already exists in S3.
public MoveTo ( S3DirectoryInfo path ) : S3FileInfo
path S3DirectoryInfo The target directory to copy to.
Результат S3FileInfo

MoveTo() публичный Метод

Moves the file to a a new location in S3.
If the file already exists in S3.
public MoveTo ( S3FileInfo file ) : S3FileInfo
file S3FileInfo The target file to copy to.
Результат S3FileInfo

MoveTo() публичный Метод

Moves the file to a a new location in S3.
If the file already exists in S3.
public MoveTo ( string bucket, string key ) : S3FileInfo
bucket string Bucket to move the file to.
key string Object key to move the file to.
Результат S3FileInfo

MoveToLocal() публичный Метод

Moves the file from S3 to the local file system in the location indicated by the path parameter.
If the file already exists locally.
public MoveToLocal ( string path ) : FileInfo
path string The location on the local file system to move the file to.
Результат System.IO.FileInfo

OpenRead() публичный Метод

Returns a Stream for reading the contents of the file.
The file is already open.
public OpenRead ( ) : Stream
Результат Stream

OpenText() публичный Метод

Returns a StreamReader for reading the contents of the file.
The file is already open.
public OpenText ( ) : StreamReader
Результат System.IO.StreamReader

OpenWrite() публичный Метод

Returns a Stream for writing to S3. If the file already exists it will be overwritten.
The file is already open.
public OpenWrite ( ) : Stream
Результат Stream

Replace() публичный Метод

Replaces the destination file with the content of this file and then deletes the orignial file. If a backupDir is specifed then the content of destination file is backup to it.
public Replace ( S3DirectoryInfo destDir, S3DirectoryInfo backupDir ) : S3FileInfo
destDir S3DirectoryInfo Where the contents of this file will be copy to.
backupDir S3DirectoryInfo If specified the destFile is backup to it.
Результат S3FileInfo

Replace() публичный Метод

Replaces the destination file with the content of this file and then deletes the orignial file. If a backupFile is specifed then the content of destination file is backup to it.
public Replace ( S3FileInfo destFile, S3FileInfo backupFile ) : S3FileInfo
destFile S3FileInfo Where the contents of this file will be copy to.
backupFile S3FileInfo If specified the destFile is backup to it.
Результат S3FileInfo

Replace() публичный Метод

Replaces the destination file with the content of this file and then deletes the orignial file. If a backup location is specifed then the content of destination file is backup to it.
public Replace ( string destinationBucket, string destinationKey, string backupBucket, string backupKey ) : S3FileInfo
destinationBucket string Destination bucket of this file will be copy to.
destinationKey string Destination object key of this file will be copy to.
backupBucket string Backup bucket to store the contents of the destination file.
backupKey string Backup object key to store the contents of the destination file.
Результат S3FileInfo

ReplaceLocal() публичный Метод

Replaces the content of the destination file on the local file system with the content from this file from S3. If a backup file is specified then the content of the destination file is backup to it.
public ReplaceLocal ( string destinationFileName, string destinationBackupFileName ) : FileInfo
destinationFileName string
destinationBackupFileName string
Результат System.IO.FileInfo

S3FileInfo() публичный Метод

Initialize a new instance of the S3FileInfo class for the specified S3 bucket and S3 object key.
public S3FileInfo ( IAmazonS3 s3Client, string bucket, string key ) : System
s3Client IAmazonS3 S3 client which is used to access the S3 resources.
bucket string Name of the S3 bucket.
key string The S3 object key.
Результат System

ToString() публичный Метод

public ToString ( ) : string
Результат string