AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Mimics the System.IO.FileInfo for a file in S3. It exposes properties and methods manipulating files in S3.
Namespace: Amazon.S3.IO
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z
public sealed class S3FileInfo IS3FileSystemInfo
The S3FileInfo type exposes the following members
Name | Description | |
---|---|---|
S3FileInfo(IAmazonS3, string, string) |
Initialize a new instance of the S3FileInfo class for the specified S3 bucket and S3 object key. |
Name | Type | Description | |
---|---|---|---|
Directory | Amazon.S3.IO.S3DirectoryInfo |
Returns the parent S3DirectoryInfo. |
|
DirectoryName | System.String |
The full name of parent directory. |
|
Exists | System.Boolean |
Checks S3 if the file exists in S3 and return true if it does. |
|
Extension | System.String |
Gets the file's extension. |
|
FullName | System.String |
Returns the full path including the bucket. |
|
LastWriteTime | System.DateTime |
Returns the last time the file was modified. |
|
LastWriteTimeUtc | System.DateTime |
Returns the last time the file was modified in UTC. |
|
Length | System.Int64 |
Returns the content length of the file. |
|
Name | System.String |
Returns the file name without its directory name. |
|
Type | Amazon.S3.IO.FileSystemType |
Returns the type of file system element. |
Name | Description | |
---|---|---|
CopyFromLocal(string) |
Copies the file from the local file system to S3. If the file already exists in S3 than an ArgumentException is thrown. |
|
CopyFromLocal(string, bool) |
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(string, string) |
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, string, bool) |
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. |
|
CopyTo(S3DirectoryInfo) |
Copies this file to the target directory. If the file already exists in S3 than an ArgumentException is thrown. |
|
CopyTo(S3DirectoryInfo, bool) |
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) |
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, bool) |
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. |
|
CopyToLocal(string) |
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, bool) |
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() |
Returns a Stream that can be used to write data to S3. |
|
CreateText() |
Returns a StreamWriter that can be used to write data to S3. |
|
Delete() |
Deletes the from S3. |
|
MoveFromLocal(string) |
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, bool) |
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(string, string) |
Moves the file to a a new location in S3. |
|
MoveTo(S3DirectoryInfo) |
Moves the file to a a new location in S3. |
|
MoveTo(S3FileInfo) |
Moves the file to a a new location in S3. |
|
MoveToLocal(string) |
Moves the file from S3 to the local file system in the location indicated by the path parameter. |
|
OpenRead() |
Returns a Stream for reading the contents of the file. |
|
OpenText() |
Returns a StreamReader for reading the contents of the file. |
|
OpenWrite() |
Returns a Stream for writing to S3. If the file already exists it will be overwritten. |
|
Replace(string, string, string, string) |
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. |
|
Replace(S3DirectoryInfo, S3DirectoryInfo) |
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, 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. |
|
ReplaceLocal(string, string) |
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. |
.NET Framework:
Supported in: 4.5 and newer, 3.5