Package loci.common
Class S3Handle
java.lang.Object
loci.common.StreamHandle
loci.common.S3Handle
- All Implemented Interfaces:
DataInput,DataOutput,IRandomAccess
Deprecated.
The S3 implementations and services will be removed from
the ome-common library in version 7.0.0
Provides random access to S3 buckets using the IRandomAccess interface.
Instances of S3Handle are read-only.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class loci.common.StreamHandle
StreamHandle.Settings -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Open an S3 fileS3Handle(String uristr, boolean initialize, StreamHandle.Settings s) Deprecated.Open an S3 file -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcacheObject(String url, StreamHandle.Settings s) Deprecated.Download an S3 object to a file system cache if it doesn't already existstatic booleancanHandleScheme(String url) Deprecated.Return true if this is a URL with an s3 schemeprotected voidconnect()Deprecated.Connect to the serverprotected voiddownloadObject(Path destination) Deprecated.booleanexists()Deprecated.Does this represent an accessible location?Deprecated.Deprecated.getPath()Deprecated.intgetPort()Deprecated.Deprecated.protected voidDeprecated.Check bucket or object existsbooleanisBucket()Deprecated.Is this an accessible bucket?longlength()Deprecated.Returns the length of this stream.protected voidDeprecated.Close and reopen the stream; the stream pointer and mark should be reset to 0.protected voidresetStream(long offset) Deprecated.Reset the stream to an offset positionvoidseek(long pos) Deprecated.Sets the stream pointer offset, measured from the beginning of this stream, at which the next read or write occurs.toString()Deprecated.Methods inherited from class loci.common.StreamHandle
close, getFilePointer, getOrder, read, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setOrder, skipBytes, skipBytes, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Field Details
-
DEFAULT_S3_PROTOCOL
Deprecated.Default protocol for fetching s3://- See Also:
-
SCHEME_PARSER
Deprecated. -
S3_MAX_FORWARD_SEEK
protected static final int S3_MAX_FORWARD_SEEKDeprecated.If seeking more than this distance reset and reopen at offset- See Also:
-
-
Constructor Details
-
S3Handle
Deprecated.Open an S3 file- Parameters:
url- the full URL to the S3 resource- Throws:
IOException- if there is an error during opening
-
S3Handle
Deprecated.Open an S3 file- Parameters:
uristr- the full URL to the S3 resourceinitialize- If true open the stream, otherwise just parse connection strings- custom settings object- Throws:
IOException- if there is an error during opening
-
-
Method Details
-
canHandleScheme
Deprecated.Return true if this is a URL with an s3 scheme- Parameters:
url- URL- Returns:
- true if this class can handle url
-
connect
Deprecated.Connect to the server- Throws:
IOException- if there was an error connecting to the server
-
initialize
Deprecated.Check bucket or object exists- Throws:
IOException- if unable to get the objectS3ClientServiceException- if unable to get the object
-
getServer
Deprecated. -
getPort
public int getPort()Deprecated. -
getBucket
Deprecated. -
getPath
Deprecated. -
cacheObject
public static String cacheObject(String url, StreamHandle.Settings s) throws IOException, HandleException Deprecated.Download an S3 object to a file system cache if it doesn't already exist- Parameters:
url- the full URL to the S3 resources- custom settings object- Returns:
- File path to the cached object
- Throws:
IOException- if there is an error during reading or writingHandleException- if no destination for the cache is provided
-
getCacheKey
Deprecated. -
downloadObject
Deprecated.- Throws:
HandleExceptionIOException
-
isBucket
public boolean isBucket()Deprecated.Is this an accessible bucket? TODO: If this bucket doesn't exist do we return false or thrown an exception?- Returns:
- True if a bucket
-
length
Deprecated.Description copied from interface:IRandomAccessReturns the length of this stream.- Specified by:
lengthin interfaceIRandomAccess- Overrides:
lengthin classStreamHandle- Returns:
- the length in bytes of the stream
- Throws:
IOException- if the length cannot be retrieved
-
seek
Deprecated.Description copied from interface:IRandomAccessSets the stream pointer offset, measured from the beginning of this stream, at which the next read or write occurs.- Specified by:
seekin interfaceIRandomAccess- Overrides:
seekin classStreamHandle- Parameters:
pos- new byte offset (pointer) in the current stream. Unless otherwise noted, may be larger or smaller than the current pointer, but must be non-negative and less than the value of #length()- Throws:
IOException- ifposis invalid or the seek fails- See Also:
-
resetStream
Deprecated.Description copied from class:StreamHandleClose and reopen the stream; the stream pointer and mark should be reset to 0. This method is called if we need to seek backwards within the stream.- Specified by:
resetStreamin classStreamHandle- Throws:
IOException- if the stream cannot be reset- See Also:
-
exists
Deprecated.Does this represent an accessible location?- Specified by:
existsin interfaceIRandomAccess- Overrides:
existsin classStreamHandle- Returns:
- true if this location is accessible
- Throws:
IOException- if unable to determine whether this location is accessible
-
resetStream
Deprecated.Reset the stream to an offset position- Parameters:
offset- Offset into object- Throws:
IOException- if there is an error during reading or writing
-
toString
Deprecated.
-