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.
-
Constructor Summary
ConstructorsConstructorDescriptionTurn a resource into a file so that anything in the conversion is properly caughtFileResource(File file) FileResource(Path path) -
Method Summary
Modifier and TypeMethodDescriptionbuffer()voidclose()voiddeleteOnClose(boolean b) getExtra()UseResource.decodeExtra(String)to properly decode the ZIP extra field structured binary data from the returned String.getFile()longvoidUseResource.encodeExtra(byte[])to properly encode the ZIP extra field structured binary data into the specified String.longsize()toString()voidvoidwrite(OutputStream out) void
-
Constructor Details
-
FileResource
- Throws:
IOException
-
FileResource
- 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:
openInputStreamin interfaceResource- Throws:
Exception
-
toString
-
write
-
write
-
write
-
lastModified
public long lastModified()- Specified by:
lastModifiedin interfaceResource
-
getExtra
Description copied from interface:ResourceUseResource.decodeExtra(String)to properly decode the ZIP extra field structured binary data from the returned String. -
setExtra
Description copied from interface:ResourceUseResource.encodeExtra(byte[])to properly encode the ZIP extra field structured binary data into the specified String. -
size
public long size() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
deleteOnClose
public void deleteOnClose(boolean b) -
getFile
-