Package aQute.bnd.osgi
Class FileResource
- java.lang.Object
-
- aQute.bnd.osgi.FileResource
-
-
Constructor Summary
Constructors Constructor Description FileResource(Resource r)
Turn a resource into a file so that anything in the conversion is properly caughtFileResource(java.io.File file)
FileResource(java.nio.file.Path path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
buffer()
void
close()
void
deleteOnClose(boolean b)
java.lang.String
getExtra()
UseResource.decodeExtra(String)
to properly decode the ZIP extra field structured binary data from the returned String.java.io.File
getFile()
long
lastModified()
java.io.InputStream
openInputStream()
void
setExtra(java.lang.String extra)
UseResource.encodeExtra(byte[])
to properly encode the ZIP extra field structured binary data into the specified String.long
size()
java.lang.String
toString()
void
write(java.io.File file)
void
write(java.io.OutputStream out)
void
write(java.nio.file.Path path)
-
-
-
Constructor Detail
-
FileResource
public FileResource(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
FileResource
public FileResource(java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.IOException
-
FileResource
public FileResource(Resource r) throws java.lang.Exception
Turn a resource into a file so that anything in the conversion is properly caught- Parameters:
r
-- Throws:
java.lang.Exception
-
-
Method Detail
-
buffer
public java.nio.ByteBuffer buffer() throws java.lang.Exception
-
openInputStream
public java.io.InputStream openInputStream() throws java.lang.Exception
- Specified by:
openInputStream
in interfaceResource
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
write
public void write(java.io.OutputStream out) throws java.lang.Exception
-
write
public void write(java.io.File file) throws java.lang.Exception
-
write
public void write(java.nio.file.Path path) throws java.lang.Exception
-
lastModified
public long lastModified()
- Specified by:
lastModified
in interfaceResource
-
getExtra
public java.lang.String getExtra()
Description copied from interface:Resource
UseResource.decodeExtra(String)
to properly decode the ZIP extra field structured binary data from the returned String.
-
setExtra
public void setExtra(java.lang.String extra)
Description copied from interface:Resource
UseResource.encodeExtra(byte[])
to properly encode the ZIP extra field structured binary data into the specified String.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
deleteOnClose
public void deleteOnClose(boolean b)
-
getFile
public java.io.File getFile()
-
-