Package aQute.bnd.osgi.repository
Class SimpleIndexer
- java.lang.Object
-
- aQute.bnd.osgi.repository.SimpleIndexer
-
public class SimpleIndexer extends java.lang.ObjectSimple program to generate an index from a set of bundles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimpleIndexer.FileAnalyzerA functional interface providing an entry point for performing additional analysis of indexed files.
-
Constructor Summary
Constructors Constructor Description SimpleIndexer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleIndexeranalyzer(SimpleIndexer.FileAnalyzer analyzer)SimpleIndexerbase(java.net.URI base)SimpleIndexercompress(boolean compress)SimpleIndexerfiles(java.util.Collection<java.io.File> files)Adds files to be indexed.java.util.List<org.osgi.resource.Resource>getResources()Return the resources so far.SimpleIndexerincrement(long increment)voidindex(java.io.File file)Generate the index to the specified file.voidindex(java.io.OutputStream outputStream)Generate the index to the specified output stream.private org.osgi.resource.ResourceindexFile(java.io.File file)SimpleIndexername(java.lang.String name)private java.net.URIrelativize(java.io.File file)SimpleIndexerreporter(Reporter reporter)private XMLResourceGeneratorrepository()
-
-
-
Field Detail
-
files
private final java.util.Set<java.io.File> files
-
base
private java.nio.file.Path base
-
compress
private boolean compress
-
name
private java.lang.String name
-
increment
private long increment
-
analyzer
private SimpleIndexer.FileAnalyzer analyzer
-
reporter
private Reporter reporter
-
-
Method Detail
-
files
public SimpleIndexer files(java.util.Collection<java.io.File> files)
Adds files to be indexed.- Parameters:
files- the files to include in the index
-
base
public SimpleIndexer base(java.net.URI base)
- Parameters:
base- the base URI from which the index urls are relative
-
compress
public SimpleIndexer compress(boolean compress)
- Parameters:
compress- compress with GZIP when true
-
name
public SimpleIndexer name(java.lang.String name)
- Parameters:
name- an optional name for the index
-
analyzer
public SimpleIndexer analyzer(SimpleIndexer.FileAnalyzer analyzer)
- Parameters:
analyzer- a resource analyzer
-
increment
public SimpleIndexer increment(long increment)
- Parameters:
increment- the timestamp of the index
-
index
public void index(java.io.OutputStream outputStream) throws java.io.IOExceptionGenerate the index to the specified output stream.- Parameters:
outputStream- the output stream to write the index file- Throws:
java.io.IOException- if a file cannot be indexed
-
index
public void index(java.io.File file) throws java.io.IOExceptionGenerate the index to the specified file.- Parameters:
file- the file to write the index file- Throws:
java.io.IOException- if a file cannot be indexed
-
getResources
public java.util.List<org.osgi.resource.Resource> getResources()
Return the resources so far.- Returns:
- the set of resources handled so far.
-
reporter
public SimpleIndexer reporter(Reporter reporter)
-
repository
private XMLResourceGenerator repository()
-
indexFile
private org.osgi.resource.Resource indexFile(java.io.File file)
-
relativize
private java.net.URI relativize(java.io.File file)
-
-