Interface IRepositoryContentProvider
- All Known Implementing Classes:
R5RepoContentProvider
public interface IRepositoryContentProvider
-
Method Summary
Modifier and TypeMethodDescriptioncheckStream(String name, InputStream stream) Check the stream for compatibility with this provider.voidgenerateIndex(Set<File> files, OutputStream output, String repoName, URI rootUri, boolean pretty, aQute.bnd.service.Registry registry, org.osgi.service.log.LogService log) Generate a new repository index to a stream.getDefaultIndexName(boolean pretty) Get the default name for an index file supported by this provider; however the actual index file may take a different name if it is overridden by the user or build settings.getName()Get the name of this provider (keep it short!).voidparseIndex(InputStream stream, URI baseUri, IRepositoryIndexProcessor processor, org.osgi.service.log.LogService log) Parse the index provided via the input stream.booleanReturn whether the content provider supports index generation.
-
Method Details
-
getName
String getName()Get the name of this provider (keep it short!). -
parseIndex
void parseIndex(InputStream stream, URI baseUri, IRepositoryIndexProcessor processor, org.osgi.service.log.LogService log) throws Exception Parse the index provided via the input stream.- Parameters:
stream- The stream that provides the index data.baseUri-processor-- Throws:
Exception
-
checkStream
Check the stream for compatibility with this provider.
- Parameters:
name- The name of the stream, which may be the file name, ornull. Providers can use this as a hint to the nature of the file.stream- An input stream that MUST support mark/reset operations.- Returns:
- Whether the stream can be handled by this provider.
- Throws:
IOException
-
supportsGeneration
boolean supportsGeneration()Return whether the content provider supports index generation. -
generateIndex
void generateIndex(Set<File> files, OutputStream output, String repoName, URI rootUri, boolean pretty, aQute.bnd.service.Registry registry, org.osgi.service.log.LogService log) throws Exception Generate a new repository index to a stream. Clients must not call this method if the provider returnsfalsefromsupportsGeneration().- Parameters:
files- The files to be indexed.output- The output stream, on which the index should be written.repoName- The name of the repository, which may be entered into the generated index.rootUri- The URI of the repository.pretty- Hint to request "pretty printing", i.e. uncompressed, indented output.registry- The bnd workspace plug-in registry if available, ornull.log- The OSGi log service if available, ornull.- Throws:
Exception- If any other error unrecoverable occurs.
-
getDefaultIndexName
Get the default name for an index file supported by this provider; however the actual index file may take a different name if it is overridden by the user or build settings.- Parameters:
pretty- Whether the pretty-printing option will be used. Providers may return a different default file name depending on this value, e.g. a non-pretty file may be compressed with the.gzextension.
-