public class FileContext extends HTTPContext implements IReleasable
Constructor and Description |
---|
FileContext(java.nio.file.Path path) |
Modifier and Type | Method and Description |
---|---|
AccessPoint |
aquireAccess()
Open an new access point, register and return it.
|
long |
getSize() |
long |
read(java.nio.channels.SocketChannel channel,
long position)
read as much bytes as possible, from the resource to the given channel.
|
void |
removeAccessPoint(AccessPoint accessPoint)
release a registered accessPoint.
|
getPath
public long getSize()
getSize
in class HTTPContext
public long read(java.nio.channels.SocketChannel channel, long position) throws java.io.IOException
HTTPContext
read
in class HTTPContext
channel
- the channel to write toposition
- the beginning position to read, inclusive.java.io.IOException
public AccessPoint aquireAccess()
IReleasable
aquireAccess
in interface IReleasable
public void removeAccessPoint(AccessPoint accessPoint)
IReleasable
removeAccessPoint
in interface IReleasable