Class MavenGroupRepository
- java.lang.Object
-
- aQute.bnd.osgi.repository.BaseRepository
-
- aQute.bnd.osgi.repository.ResourcesRepository
-
- de.mnl.osgi.bnd.repository.maven.idxmvn.MavenGroupRepository
-
- All Implemented Interfaces:
Repository
public class MavenGroupRepository extends aQute.bnd.osgi.repository.ResourcesRepository
A repository with artifacts from a single group.
-
-
Field Summary
-
Fields inherited from interface org.osgi.service.repository.Repository
URL
-
-
Constructor Summary
Constructors Constructor Description MavenGroupRepository(String groupId, Path directory, boolean requested, IndexedMavenRepository indexedRepository, aQute.bnd.http.HttpClient client, aQute.service.reporter.Reporter reporter)
Instantiates a new representation of group data backed by the specified directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Writes all changes to persistent storage and removes any backup information prepared byreset(Path, boolean)
.String
id()
Returns the group id.boolean
isRequested()
Checks if is requested.boolean
removeIfRedundant()
Removes the group directory if empty.void
reset(Path directory, boolean requested)
Clears this repository and updates the path and the requested flag.String
toString()
-
Methods inherited from class aQute.bnd.osgi.repository.ResourcesRepository
add, addAll, findProvider, findProviders, getResources, set, toCapabilities, toResourcesRepository
-
-
-
-
Constructor Detail
-
MavenGroupRepository
public MavenGroupRepository(String groupId, Path directory, boolean requested, IndexedMavenRepository indexedRepository, aQute.bnd.http.HttpClient client, aQute.service.reporter.Reporter reporter) throws IOException
Instantiates a new representation of group data backed by the specified directory.- Parameters:
groupId
- the maven groupId indexed by this repositorydirectory
- the directory used to persist datarequested
- if it is a requested group idindexedRepository
- the indexed maven repositoryclient
- the client used for remote accessreporter
- the reporter- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Detail
-
isRequested
public final boolean isRequested()
Checks if is requested.- Returns:
- the requested
-
flush
public void flush() throws IOException
Writes all changes to persistent storage and removes any backup information prepared byreset(Path, boolean)
.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
removeIfRedundant
public boolean removeIfRedundant() throws IOException
Removes the group directory if empty.- Returns:
- true, if removed
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
reset
public void reset(Path directory, boolean requested)
Clears this repository and updates the path and the requested flag. Keeps the current content as backup for reuse in a subsequent call toreload()
.- Parameters:
directory
- this group's directoryrequested
- whether this is a requested group
-
-