public class AmazonS3FileSystem extends FileSystemBase<com.amazonaws.services.s3.model.S3Object> implements IWritableFileSystem<com.amazonaws.services.s3.model.S3Object>
log
Constructor and Description |
---|
AmazonS3FileSystem() |
Modifier and Type | Method and Description |
---|---|
OutputStream |
appendFile(com.amazonaws.services.s3.model.S3Object f) |
void |
close() |
void |
configure() |
com.amazonaws.services.s3.model.S3Object |
copyFile(com.amazonaws.services.s3.model.S3Object f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Copies the file to a another folder.
|
OutputStream |
createFile(com.amazonaws.services.s3.model.S3Object f) |
void |
createFolder(String folder) |
com.amazonaws.services.s3.AmazonS3 |
createS3Client() |
void |
deleteFile(com.amazonaws.services.s3.model.S3Object f) |
boolean |
exists(com.amazonaws.services.s3.model.S3Object f) |
boolean |
folderExists(String folder) |
Map<String,Object> |
getAdditionalFileProperties(com.amazonaws.services.s3.model.S3Object f) |
static List<String> |
getAvailableRegions() |
String |
getCanonicalName(com.amazonaws.services.s3.model.S3Object f) |
com.amazonaws.ClientConfiguration |
getClientConfig() |
protected com.amazonaws.auth.AWSCredentialsProvider |
getCredentialProvider() |
long |
getFileSize(com.amazonaws.services.s3.model.S3Object f) |
Date |
getModificationTime(com.amazonaws.services.s3.model.S3Object f) |
String |
getName(com.amazonaws.services.s3.model.S3Object f)
Get a string representation of an identification of a file.
|
int |
getNumberOfFilesInFolder(String folder) |
String |
getParentFolder(com.amazonaws.services.s3.model.S3Object f) |
String |
getPhysicalDestinationName() |
DirectoryStream<com.amazonaws.services.s3.model.S3Object> |
listFiles(String folder)
Lists all files in 'folder' or in the 'root' of the filesystem (when folder is null).
|
com.amazonaws.services.s3.model.S3Object |
moveFile(com.amazonaws.services.s3.model.S3Object f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Moves the file to a another folder.
|
void |
open() |
Message |
readFile(com.amazonaws.services.s3.model.S3Object file,
String charset)
If you retrieve an S3Object, you should close this input stream as soon as possible,
because the object contents aren't buffered in memory and stream directly from Amazon S3.
|
void |
removeFolder(String folder,
boolean removeNonEmptyFolder) |
com.amazonaws.services.s3.model.S3Object |
renameFile(com.amazonaws.services.s3.model.S3Object source,
com.amazonaws.services.s3.model.S3Object destination)
Renames the file to a new name, possibly in a another folder.
|
void |
setAccessKey(String accessKey)
Access key to access to the AWS resources owned by the account
|
void |
setAuthAlias(String authAlias)
Alias used to obtain AWS credentials
|
void |
setBucketName(String bucketName)
Name of the bucket to access.
|
void |
setChunkedEncodingDisabled(boolean chunkedEncodingDisabled)
Setting this flag will result in disabling chunked encoding for all requests.
|
void |
setClientRegion(String clientRegion)
Name of the region that the client will be created from
|
void |
setForceGlobalBucketAccessEnabled(boolean forceGlobalBucketAccessEnabled)
Set whether the client should be configured with global bucket access enabled.
|
void |
setMaxConnections(int maxConnections)
Maximum concurrent connections towards S3
|
void |
setProxyHost(String proxyHost)
Proxy host
|
void |
setProxyPort(Integer proxyPort)
Proxy port
|
void |
setSecretKey(String secretKey)
Secret key to access to the AWS resources owned by the account
|
void |
setServiceEndpoint(String serviceEndpoint)
The S3 service endpoint, either with or without the protocol.
|
void |
setStorageClass(com.amazonaws.services.s3.model.StorageClass storageClass)
Set the desired storage class for the S3 object when action is move,copy or write.
|
com.amazonaws.services.s3.model.S3Object |
toFile(String filename)
Creates a local S3Object pointer, not representative with what is stored in the S3 Bucket.
|
com.amazonaws.services.s3.model.S3Object |
toFile(String folder,
String filename)
Creates a reference to a file.
|
getMaxNumberOfMessagesToList, isOpen, setMaxNumberOfMessagesToList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isOpen
getDomain
public void configure() throws ConfigurationException
configure
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
ConfigurationException
public void open() throws FileSystemException
open
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
open
in class FileSystemBase<com.amazonaws.services.s3.model.S3Object>
FileSystemException
protected com.amazonaws.auth.AWSCredentialsProvider getCredentialProvider()
public com.amazonaws.services.s3.AmazonS3 createS3Client()
public void close() throws FileSystemException
close
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
close
in class FileSystemBase<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public com.amazonaws.services.s3.model.S3Object toFile(String filename) throws FileSystemException
toFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public com.amazonaws.services.s3.model.S3Object toFile(String folder, String filename) throws FileSystemException
IBasicFileSystem
toFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public int getNumberOfFilesInFolder(String folder) throws FileSystemException
getNumberOfFilesInFolder
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
getNumberOfFilesInFolder
in class FileSystemBase<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public DirectoryStream<com.amazonaws.services.s3.model.S3Object> listFiles(String folder) throws FileSystemException
IBasicFileSystem
listFiles
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public boolean exists(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
exists
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public OutputStream createFile(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException, IOException
createFile
in interface IWritableFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
IOException
public OutputStream appendFile(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException, IOException
appendFile
in interface IWritableFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
IOException
public Message readFile(com.amazonaws.services.s3.model.S3Object file, String charset) throws FileSystemException, IOException
readFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
IOException
public void deleteFile(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
deleteFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public boolean folderExists(String folder) throws FileSystemException
folderExists
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public void createFolder(String folder) throws FileSystemException
createFolder
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public void removeFolder(String folder, boolean removeNonEmptyFolder) throws FileSystemException
removeFolder
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public com.amazonaws.services.s3.model.S3Object renameFile(com.amazonaws.services.s3.model.S3Object source, com.amazonaws.services.s3.model.S3Object destination) throws FileSystemException
IWritableFileSystem
renameFile
in interface IWritableFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public com.amazonaws.services.s3.model.S3Object copyFile(com.amazonaws.services.s3.model.S3Object f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is copied;resultantMustBeReturned
is not set, then a null result returned might also mean the file was copied successfully, but with unknown destination;copyFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
resultantMustBeReturned
- TODOFileSystemException
public com.amazonaws.services.s3.model.S3Object moveFile(com.amazonaws.services.s3.model.S3Object f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is moved;resultantMustBeReturned
is not set, then a null result returned might also mean the file was moved successfully, but with unknown destination;moveFile
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
resultantMustBeReturned
- TODOFileSystemException
public Map<String,Object> getAdditionalFileProperties(com.amazonaws.services.s3.model.S3Object f)
getAdditionalFileProperties
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
public String getName(com.amazonaws.services.s3.model.S3Object f)
IBasicFileSystem
IBasicFileSystem.toFile(String)
.
Can reflect name a file has in its folder, is not expected to be unique over folders.getName
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
public String getParentFolder(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
getParentFolder
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public String getCanonicalName(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
getCanonicalName
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public long getFileSize(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
getFileSize
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public Date getModificationTime(com.amazonaws.services.s3.model.S3Object f) throws FileSystemException
getModificationTime
in interface IBasicFileSystem<com.amazonaws.services.s3.model.S3Object>
FileSystemException
public com.amazonaws.ClientConfiguration getClientConfig()
public String getPhysicalDestinationName()
getPhysicalDestinationName
in interface HasPhysicalDestination
public void setAccessKey(String accessKey)
public void setSecretKey(String secretKey)
public void setAuthAlias(String authAlias)
public void setChunkedEncodingDisabled(boolean chunkedEncodingDisabled)
public void setForceGlobalBucketAccessEnabled(boolean forceGlobalBucketAccessEnabled)
public void setServiceEndpoint(String serviceEndpoint)
@Mandatory public void setClientRegion(String clientRegion)
public void setBucketName(String bucketName)
public void setProxyHost(String proxyHost)
public void setProxyPort(Integer proxyPort)
public void setStorageClass(com.amazonaws.services.s3.model.StorageClass storageClass)
public void setMaxConnections(int maxConnections)
Copyright © 2023 Frank!Framework. All rights reserved.