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, WriteResource, ZipResource
-
Method Summary
Modifier and TypeMethodDescriptionbuffer()static byte[]decodeExtra(String encoded) Decode a String to a ZIP extra field.static StringencodeExtra(byte[] extra) Encode the ZIP extra field as a String.static Resourcestatic ResourcefromURL(URL url, HttpClient client) getExtra()UsedecodeExtra(String)to properly decode the ZIP extra field structured binary data from the returned String.longvoidUseencodeExtra(byte[])to properly encode the ZIP extra field structured binary data into the specified String.longsize()default voidvoidwrite(OutputStream out) default void
-
Method Details
-
openInputStream
- Throws:
Exception
-
write
- Throws:
Exception
-
write
-
write
-
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
-
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:
-