Package aQute.bnd.osgi.repository
Class XMLResourceGenerator
- java.lang.Object
-
- aQute.bnd.osgi.repository.XMLResourceGenerator
-
public class XMLResourceGenerator extends java.lang.ObjectCan turn an OSGi repository into anhttp://www.osgi.org/xmlns/repository/v1.0.0XML file. See the Repository spec in OSGi.
-
-
Constructor Summary
Constructors Constructor Description XMLResourceGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidattributes(Tag cr, java.util.Map<java.lang.String,java.lang.Object> attributes)XMLResourceGeneratorbase(java.net.URI base)XMLResourceGeneratorcompress()private voiddirectives(Tag cr, java.util.Map<java.lang.String,java.lang.String> directives)XMLResourceGeneratorincrement(long increment)Note that callingname(String)sets increment toSystem.currentTimeMillis().XMLResourceGeneratorindent(int n)private booleanisContent(Tag cr)XMLResourceGeneratorname(java.lang.String name)Note that callingname(String)sets increment toSystem.currentTimeMillis().XMLResourceGeneratorreferral(java.net.URI reference, int depth)private java.lang.Stringrelativize(java.lang.String value)XMLResourceGeneratorrepository(org.osgi.service.repository.Repository repository)XMLResourceGeneratorresource(org.osgi.resource.Resource resource)XMLResourceGeneratorresources(java.util.Collection<? extends org.osgi.resource.Resource> resources)voidsave(java.io.File location)voidsave(java.io.OutputStream out)
-
-
-
Field Detail
-
repository
private Tag repository
-
visited
private java.util.Set<org.osgi.resource.Resource> visited
-
indent
private int indent
-
compress
private boolean compress
-
base
private java.net.URI base
-
-
Method Detail
-
save
public void save(java.io.File location) throws java.io.IOException- Throws:
java.io.IOException
-
save
public void save(java.io.OutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
name
public XMLResourceGenerator name(java.lang.String 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
public XMLResourceGenerator increment(long 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
public XMLResourceGenerator referral(java.net.URI reference, int depth)
-
repository
public XMLResourceGenerator repository(org.osgi.service.repository.Repository repository)
-
resources
public XMLResourceGenerator resources(java.util.Collection<? extends org.osgi.resource.Resource> resources)
-
resource
public XMLResourceGenerator resource(org.osgi.resource.Resource resource)
-
directives
private void directives(Tag cr, java.util.Map<java.lang.String,java.lang.String> directives)
-
attributes
private void attributes(Tag cr, java.util.Map<java.lang.String,java.lang.Object> attributes)
-
isContent
private boolean isContent(Tag cr)
-
relativize
private java.lang.String relativize(java.lang.String value)
-
indent
public XMLResourceGenerator indent(int n)
-
compress
public XMLResourceGenerator compress()
-
base
public XMLResourceGenerator base(java.net.URI base)
- Parameters:
base- the base URI from which the index urls are relative
-
-