Package net.microfalx.resource.s3
Class S3Resource
java.lang.Object
net.microfalx.resource.AbstractResource
net.microfalx.resource.AbstractStatefulResource<io.minio.MinioClient,io.minio.MinioClient>
net.microfalx.resource.s3.S3Resource
- All Implemented Interfaces:
Serializable,AutoCloseable,Cloneable,net.microfalx.resource.Resource,net.microfalx.resource.StatefulResource
public class S3Resource
extends net.microfalx.resource.AbstractStatefulResource<io.minio.MinioClient,io.minio.MinioClient>
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.microfalx.resource.Resource
net.microfalx.resource.Resource.Type -
Field Summary
Fields inherited from interface net.microfalx.resource.Resource
END_POINT_ATTR, FILE_NAME_ATTR, HASH_ATTR, NULL, PATH_ATTR -
Method Summary
Modifier and TypeMethodDescriptionstatic net.microfalx.resource.StatefulResourceCreates a resource and auto-detects the type.static net.microfalx.resource.StatefulResourcecreate(net.microfalx.resource.Resource.Type type, URI uri, net.microfalx.resource.Credential credential) Creates a resource and auto-detects the type.static net.microfalx.resource.StatefulResourceCreates a resource with a directory type.booleandoExists()static net.microfalx.resource.StatefulResourceCreates a resource with a file type.net.microfalx.resource.Resourcestatic URLReturns the default endpoint.Returns the URL to the S3 object store.getEtag()Returns the ETag attached to the object.getOwner()Returns the owner attached to the object.net.microfalx.resource.Resourcenet.microfalx.resource.Resourcestatic voidsetDefaultEndpoint(URL url) Changes the default endpoint.toURI()Methods inherited from class net.microfalx.resource.AbstractStatefulResource
closeMethods inherited from class net.microfalx.resource.AbstractResource
copyFrom, copyFrom, copyPropertiesFrom, create, createParents, delete, detectMimeType, empty, equals, exists, get, getAttribute, getAttributeNames, getAttributes, getCredential, getDescription, getFileExtension, getFragment, getId, getInputStream, getInputStream, getMimeType, getName, getOutputStream, getParent, getPath, getPath, getPath, getReader, getRoot, getType, getWriter, hasAttribute, hashCode, isAbsolutePath, isLocal, lastModified, length, list, loadAsBytes, loadAsBytes, loadAsString, loadAsString, toFile, toHash, toString, toURL, walk, walk, withAbsolutePath, withAttribute, withAttributes, withCredential, withDescription, withFragment, withMimeType, withMimeType, withNameMethods inherited from interface net.microfalx.resource.Resource
copyFrom, copyFrom, copyPropertiesFrom, create, createParents, delete, detectMimeType, empty, exists, get, getAttribute, getAttributeNames, getAttributes, getCredential, getDescription, getFileExtension, getFragment, getId, getInputStream, getInputStream, getMimeType, getName, getOutputStream, getParent, getPath, getPath, getPath, getReader, getRoot, getType, getWriter, hasAttribute, isAbsolutePath, isDirectory, isFile, isLocal, isReadable, isWritable, lastModified, length, list, loadAsBytes, loadAsBytes, loadAsString, loadAsString, toFile, toHash, toURL, walk, walk, withAbsolutePath, withAttribute, withAttributes, withCredential, withDescription, withFragment, withMimeType, withMimeType, withName
-
Method Details
-
file
public static net.microfalx.resource.StatefulResource file(URI uri, net.microfalx.resource.Credential credential) Creates a resource with a file type.- Parameters:
uri- the URIcredential- the credential- Returns:
- a non-null instance
-
directory
public static net.microfalx.resource.StatefulResource directory(URI uri, net.microfalx.resource.Credential credential) Creates a resource with a directory type.- Parameters:
uri- the URIcredential- the credential- Returns:
- a non-null instance
-
create
public static net.microfalx.resource.StatefulResource create(URI uri, net.microfalx.resource.Credential credential) Creates a resource and auto-detects the type.- Parameters:
uri- the URIcredential- the credential- Returns:
- a non-null instance
-
create
public static net.microfalx.resource.StatefulResource create(net.microfalx.resource.Resource.Type type, URI uri, net.microfalx.resource.Credential credential) Creates a resource and auto-detects the type.- Parameters:
type- the resource typeuri- the URIcredential- the credential- Returns:
- a non-null instance
-
setDefaultEndpoint
Changes the default endpoint.- Parameters:
url- the URL of the S3 object store
-
getDefaultEndpoint
Returns the default endpoint.- Returns:
- the endpoint, NULL if a default one is not provided
-
getEndpoint
Returns the URL to the S3 object store.- Returns:
- a non-null instance
- Throws:
S3Exception- if the URL cannot be retrieved
-
getFileName
-
getEtag
Returns the ETag attached to the object.- Returns:
- the ETag, null if not available
- Throws:
IOException
-
getOwner
Returns the owner attached to the object.- Returns:
- the owner, null if not available
- Throws:
IOException
-
doExists
- Throws:
IOException
-
resolve
- Specified by:
resolvein interfacenet.microfalx.resource.Resource- Overrides:
resolvein classnet.microfalx.resource.AbstractResource
-
resolve
public net.microfalx.resource.Resource resolve(String path, net.microfalx.resource.Resource.Type type) - Specified by:
resolvein interfacenet.microfalx.resource.Resource- Overrides:
resolvein classnet.microfalx.resource.AbstractResource
-
get
-
toURI
-