Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
buffer |
private static java.nio.ByteBuffer |
CLOSED |
private boolean |
deleteOnClose |
private java.lang.String |
extra |
private java.nio.file.Path |
file |
private long |
lastModified |
private long |
size |
private static int |
THRESHOLD |
Constructor and Description |
---|
FileResource(java.io.File file) |
FileResource(java.nio.file.Path path) |
FileResource(java.nio.file.Path path,
java.nio.file.attribute.BasicFileAttributes attrs) |
FileResource(Resource r)
Turn a resource into a file so that anything in the conversion is
properly caught
|
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
buffer() |
void |
close() |
void |
deleteOnClose(boolean b) |
java.lang.String |
getExtra() |
java.io.File |
getFile() |
long |
lastModified() |
java.io.InputStream |
openInputStream() |
void |
setExtra(java.lang.String extra) |
long |
size() |
java.lang.String |
toString() |
void |
write(java.io.OutputStream out) |
private static final int THRESHOLD
private static final java.nio.ByteBuffer CLOSED
private java.nio.ByteBuffer buffer
private final java.nio.file.Path file
private java.lang.String extra
private boolean deleteOnClose
private final long lastModified
private final long size
public FileResource(java.io.File file) throws java.io.IOException
java.io.IOException
public FileResource(java.nio.file.Path path) throws java.io.IOException
java.io.IOException
FileResource(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
java.io.IOException
public FileResource(Resource r) throws java.lang.Exception
r
- java.lang.Exception
public java.nio.ByteBuffer buffer() throws java.lang.Exception
public java.io.InputStream openInputStream() throws java.lang.Exception
openInputStream
in interface Resource
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public void write(java.io.OutputStream out) throws java.lang.Exception
public long lastModified()
lastModified
in interface Resource
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void deleteOnClose(boolean b)
public java.io.File getFile()