Package aQute.bnd.osgi
Class URLResource
- java.lang.Object
-
- aQute.bnd.osgi.URLResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
URLResource.JarURLUtil
Use JarURLConnection to parse jar: URL into URL to jar URL and entry.
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
buffer
private HttpClient
client
private static java.nio.ByteBuffer
CLOSED
private java.lang.String
extra
private long
lastModified
private int
size
private java.net.URL
url
-
Constructor Summary
Constructors Constructor Description URLResource(java.net.URL url, HttpClient client)
This constructor is not for use other than byResource.fromURL(URL)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
buffer()
void
close()
private java.nio.ByteBuffer
getBuffer()
java.lang.String
getExtra()
UseResource.decodeExtra(String)
to properly decode the ZIP extra field structured binary data from the returned String.long
lastModified()
private java.io.InputStream
open()
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.OutputStream out)
-
-
-
Field Detail
-
CLOSED
private static final java.nio.ByteBuffer CLOSED
-
buffer
private java.nio.ByteBuffer buffer
-
url
private final java.net.URL url
-
client
private final HttpClient client
-
extra
private java.lang.String extra
-
lastModified
private long lastModified
-
size
private int size
-
-
Constructor Detail
-
URLResource
URLResource(java.net.URL url, HttpClient client)
This constructor is not for use other than byResource.fromURL(URL)
.- See Also:
Resource.fromURL(URL)
-
-
Method Detail
-
buffer
public java.nio.ByteBuffer buffer() throws java.lang.Exception
-
getBuffer
private java.nio.ByteBuffer getBuffer() throws java.lang.Exception
- Throws:
java.lang.Exception
-
open
private java.io.InputStream open() throws java.lang.Exception
- 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
-
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.
-
size
public long size() throws java.lang.Exception
-
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
-
-