Package aQute.bnd.osgi
Class FileResource
java.lang.Object
aQute.bnd.osgi.FileResource
- All Implemented Interfaces:
Resource
,Closeable
,AutoCloseable
Resource for a file. This class implementation assumes the file does not
change underneath this object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer
private static final ByteBuffer
private boolean
private String
private final Path
private final long
private final long
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionTurn a resource into a file so that anything in the conversion is properly caughtFileResource
(File file) FileResource
(Path path) FileResource
(Path path, BasicFileAttributes attrs) -
Method Summary
Modifier and TypeMethodDescriptionbuffer()
void
close()
void
deleteOnClose
(boolean b) getExtra()
getFile()
long
void
long
size()
toString()
void
write
(OutputStream out)
-
Field Details
-
THRESHOLD
private static final int THRESHOLD- See Also:
-
CLOSED
-
buffer
-
file
-
extra
-
deleteOnClose
private boolean deleteOnClose -
lastModified
private final long lastModified -
size
private final long size
-
-
Constructor Details
-
FileResource
- Throws:
IOException
-
FileResource
- Throws:
IOException
-
FileResource
FileResource(Path path, BasicFileAttributes attrs) throws IOException - Throws:
IOException
-
FileResource
Turn a resource into a file so that anything in the conversion is properly caught- Parameters:
r
-- Throws:
Exception
-
-
Method Details
-
buffer
-
openInputStream
- Specified by:
openInputStream
in interfaceResource
- Throws:
Exception
-
toString
-
write
-
lastModified
public long lastModified()- Specified by:
lastModified
in interfaceResource
-
getExtra
-
setExtra
-
size
public long size() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
deleteOnClose
public void deleteOnClose(boolean b) -
getFile
-