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.
|
getPathpublic long getSize()
getSize in class HTTPContextpublic long read(java.nio.channels.SocketChannel channel,
long position)
throws java.io.IOException
HTTPContextread in class HTTPContextchannel - the channel to write toposition - the beginning position to read, inclusive.java.io.IOExceptionpublic AccessPoint aquireAccess()
IReleasableaquireAccess in interface IReleasablepublic void removeAccessPoint(AccessPoint accessPoint)
IReleasableremoveAccessPoint in interface IReleasable