public class HTTPHandle extends AbstractSeekableStreamHandle<HTTPLocation>
DataHandle
for a HTTPLocation
.DataHandle.ByteOrder
DEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE
Constructor and Description |
---|
HTTPHandle() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Tests whether this handle's location actually exists at the source.
|
Class<HTTPLocation> |
getType()
Gets the type associated with the object.
|
InputStream |
in()
Gets an input stream for reading data, positioned at the current offset.
|
boolean |
isReadable()
Gets whether reading from this handle is supported.
|
boolean |
isWritable()
Gets whether writing to this handle is supported.
|
Date |
lastModified()
Gets the last modified timestamp of the location.
|
long |
length()
Returns the length of the data in bytes.
|
OutputStream |
out()
Gets an output stream for writing data, positioned at the current offset.
|
protected boolean |
recreatePossible()
In some implementations of this class, the ability to recreate the stream
depends on external factors (e.g.
|
void |
recreateStreamFromPos(long pos)
Reconnects to the HTTP server, requesting the content starting from the
indicated position.
|
void |
resetStream()
Resets the stream to its start.
|
void |
setLength(long length)
Sets the new length of the handle.
|
seek, setJumpCutoff
offset, setOffset
conversionBuffer, getEncoding, getOrder, setEncoding, setOrder
get, set
supports
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
advance, close, ensureReadable, ensureWritable, jump, read, read, readByte, setOffset, write, write, writeByte
available, checksum, conversionBuffer, findString, findString, findString, findString, getEncoding, getOrder, isBigEndian, isLittleEndian, offset, read, readBoolean, readChar, readCString, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readString, readString, readUnsignedByte, readUnsignedShort, readUTF, setEncoding, setLittleEndian, setOrder, skip, skipBytes, write, writeBoolean, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLine, writeLong, writeShort, writeUTF
get, set
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public void resetStream() throws IOException
ResettableStreamHandle
IOException
- If something goes wrong with the resetpublic InputStream in()
StreamHandle
public OutputStream out()
StreamHandle
public boolean isReadable()
DataHandle
public boolean isWritable()
DataHandle
public boolean exists() throws IOException
DataHandle
IOException
- If something goes wrong with the existence check.public Date lastModified() throws IOException
DataHandle
IOException
- If something goes wrong with the last modified check.public long length() throws IOException
DataHandle
IOException
public void setLength(long length) throws IOException
DataHandle
length
- New length.IOException
- If there is an error changing the handle's length.public Class<HTTPLocation> getType()
Typed
public void recreateStreamFromPos(long pos) throws IOException
recreateStreamFromPos
in class AbstractSeekableStreamHandle<HTTPLocation>
pos
- the new start positionIOException
protected boolean recreatePossible() throws IOException
AbstractSeekableStreamHandle
recreatePossible
in class AbstractSeekableStreamHandle<HTTPLocation>
IOException
Copyright © 2015–2022 SciJava. All rights reserved.