Class XMLResourceGenerator
java.lang.Object
aQute.bnd.osgi.repository.XMLResourceGenerator
Can turn an OSGi repository into an
http://www.osgi.org/xmlns/repository/v1.0.0 XML file. See the
Repository spec in OSGi.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofXMLResourceGeneratorwith an empty repository. -
Method Summary
Modifier and TypeMethodDescriptioncompress()Enables compression for the generated XML document.increment(long increment) Note that callingname(String)sets increment toSystem.currentTimeMillis().indent(int n) Sets the indentation level for the generated XML document.Note that callingname(String)sets increment toSystem.currentTimeMillis().Adds a referral to this generator.repository(org.osgi.service.repository.Repository repository) Adds all the resources in the specified repository to this generator.resource(org.osgi.resource.Resource resource) Adds the specified resource to this generator.resources(Collection<? extends org.osgi.resource.Resource> resources) Adds all the resources in the specified collection to this generator.voidSaves the contents of this generator to the specified file.voidsave(OutputStream out) Saves the contents of this generator to the specified output stream.
-
Constructor Details
-
XMLResourceGenerator
public XMLResourceGenerator()Creates a new instance ofXMLResourceGeneratorwith an empty repository.
-
-
Method Details
-
save
Saves the contents of this generator to the specified file.- Parameters:
location- The file to save the contents to.- Throws:
IOException- If an I/O error occurs.
-
save
Saves the contents of this generator to the specified output stream.- Parameters:
out- The output stream to save the contents to.- Throws:
IOException- If an I/O error occurs.
-
name
Note that callingname(String)sets increment toSystem.currentTimeMillis(). In order to retain backward compatibility that is not change. Therefore, in order to specify a valueincrement(long)should be called after.- Parameters:
name-- Returns:
- this
-
increment
Note that callingname(String)sets increment toSystem.currentTimeMillis(). In order to retain backward compatibility that is not change. Therefore, in order to specify a valueincrement(long)should be called after.- Parameters:
increment-- Returns:
- this
-
referral
Adds a referral to this generator.- Parameters:
reference- The URI of the referral.depth- The depth of the referral.- Returns:
- This generator.
-
repository
Adds all the resources in the specified repository to this generator.- Parameters:
repository- The repository whose resources to add.- Returns:
- This generator.
-
resources
Adds all the resources in the specified collection to this generator.- Parameters:
resources- The resources to add.- Returns:
- This generator.
-
resource
Adds the specified resource to this generator.- Parameters:
resource- The resource to add.- Returns:
- This generator.
-
indent
Sets the indentation level for the generated XML document.- Parameters:
n- The number of spaces for each indentation level.- Returns:
- This generator.
-
compress
Enables compression for the generated XML document.- Returns:
- This generator.
-
base
- Parameters:
base- the base URI from which the index urls are relative
-