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

C# |
public S3FileInfo CopyTo( S3DirectoryInfo dir )

- dir (S3DirectoryInfo)
- Target directory where to copy the file to.

S3FileInfo of the newly copied file.

Exception | Condition |
---|---|
ArgumentException | If the directory does not exist. |
IOException | If the file already exists in S3. |
WebException | |
AmazonS3Exception |