Package aQute.bnd.osgi.repository
Class SimpleIndexer
- java.lang.Object
-
- aQute.bnd.osgi.repository.SimpleIndexer
-
public class SimpleIndexer extends java.lang.Object
Simple program to generate an index from a set of bundles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SimpleIndexer.FileAnalyzer
A 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 SimpleIndexer
analyzer(SimpleIndexer.FileAnalyzer analyzer)
SimpleIndexer
base(java.net.URI base)
SimpleIndexer
compress(boolean compress)
SimpleIndexer
files(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.SimpleIndexer
increment(long increment)
void
index(java.io.File file)
Generate the index to the specified file.void
index(java.io.OutputStream outputStream)
Generate the index to the specified output stream.private org.osgi.resource.Resource
indexFile(java.io.File file)
SimpleIndexer
name(java.lang.String name)
private java.net.URI
relativize(java.io.File file)
SimpleIndexer
reporter(Reporter reporter)
private XMLResourceGenerator
repository()
-
-
-
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.IOException
Generate 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.IOException
Generate 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)
-
-