Package aQute.bnd.osgi
Interface Resource
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
AbstractResource
,CalltreeResource
,CombinedResource
,CommandResource
,CoverageResource
,EmbeddedResource
,FileResource
,JarResource
,ManifestResource
,MetaTypeReader
,PomFromManifest
,PomPropertiesResource
,PomResource
,PreprocessResource
,PropertiesResource
,TagResource
,URLResource
,WriteResource
,ZipResource
-
Method Summary
Modifier and TypeMethodDescriptionbuffer()
static byte[]
decodeExtra
(String encoded) Decode a String to a ZIP extra field.static String
encodeExtra
(byte[] extra) Encode the ZIP extra field as a String.static Resource
static Resource
fromURL
(URL url, HttpClient client) getExtra()
UsedecodeExtra(String)
to properly decode the ZIP extra field structured binary data from the returned String.long
void
UseencodeExtra(byte[])
to properly encode the ZIP extra field structured binary data into the specified String.long
size()
default void
void
write
(OutputStream out) default void
-
Method Details
-
openInputStream
- Throws:
Exception
-
write
- Throws:
Exception
-
write
- Throws:
Exception
-
write
- Throws:
Exception
-
lastModified
long lastModified() -
setExtra
UseencodeExtra(byte[])
to properly encode the ZIP extra field structured binary data into the specified String.- Parameters:
extra
- A String encoding the ZIP extra field.
-
getExtra
String getExtra()UsedecodeExtra(String)
to properly decode the ZIP extra field structured binary data from the returned String.- Returns:
- A String encoding the ZIP extra field.
-
size
- Throws:
Exception
-
buffer
- Throws:
Exception
-
fromURL
- Throws:
IOException
-
fromURL
- Throws:
IOException
-
encodeExtra
Encode the ZIP extra field as a String.Since the Resource API uses a String as the storage format for the extra field and the extra field is structured binary data, we encode the byte array as a char array in a String. Since the byte array can have an odd length, we must also encode the array length so that we can decode into the correct byte array length.
- Parameters:
extra
- A ZIP extra field.- Returns:
- A String encoding of the specified ZIP extra field.
- See Also:
-
decodeExtra
Decode a String to a ZIP extra field.Since the Resource API uses a String as the storage format for the extra field and the extra field is structured binary data, we encode the byte array as a char array in a String. Since the byte array can have an odd length, we must also encode the array length so that we can decode into the correct byte array length.
- Parameters:
encoded
- A String encoding of the ZIP extra field.- Returns:
- The ZIP extra field encoded in the specified string.
- See Also:
-