public class FileBasedTychoRepositoryIndex extends java.lang.Object implements TychoRepositoryIndex
Modifier and Type | Field and Description |
---|---|
private java.util.Set<GAV> |
addedGavs |
static java.lang.String |
ARTIFACTS_INDEX_RELPATH |
private static java.lang.String |
ENCODING |
private static java.lang.String |
EOL |
private FileLocker |
fileLocker |
private java.util.Set<GAV> |
gavs |
private java.io.File |
indexFile |
private MavenLogger |
logger |
static java.lang.String |
METADATA_INDEX_RELPATH |
private java.util.Set<GAV> |
removedGavs |
Modifier | Constructor and Description |
---|---|
private |
FileBasedTychoRepositoryIndex(java.io.File indexFile,
FileLockService fileLockService,
MavenLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
addGav(GAV gav)
Adds a GAV to the index
|
static TychoRepositoryIndex |
createArtifactsIndex(java.io.File basedir,
FileLockService fileLockService,
MavenLogger logger) |
static TychoRepositoryIndex |
createMetadataIndex(java.io.File basedir,
FileLockService fileLockService,
MavenLogger logger) |
java.util.Set<GAV> |
getProjectGAVs()
Receive the set of GAVs contained in this index
|
private void |
lock() |
private java.util.Set<GAV> |
read(java.io.InputStream inStream) |
private void |
reconcile() |
void |
removeGav(GAV gav)
Remove a GAV from the index.
|
void |
save()
Changes performed via
TychoRepositoryIndex.addGav(GAV) , TychoRepositoryIndex.removeGav(GAV) will only be reflected
in the memory state of the index. |
private void |
unlock() |
private void |
write(java.io.OutputStream outStream) |
public static final java.lang.String ARTIFACTS_INDEX_RELPATH
public static final java.lang.String METADATA_INDEX_RELPATH
private static final java.lang.String ENCODING
private static final java.lang.String EOL
private final java.io.File indexFile
private final MavenLogger logger
private FileLocker fileLocker
private java.util.Set<GAV> addedGavs
private java.util.Set<GAV> removedGavs
private java.util.Set<GAV> gavs
private FileBasedTychoRepositoryIndex(java.io.File indexFile, FileLockService fileLockService, MavenLogger logger)
private void lock()
private void unlock()
public java.util.Set<GAV> getProjectGAVs()
TychoRepositoryIndex
getProjectGAVs
in interface TychoRepositoryIndex
public void addGav(GAV gav)
TychoRepositoryIndex
addGav
in interface TychoRepositoryIndex
gav
- not null
#save()}
public void removeGav(GAV gav)
TychoRepositoryIndex
removeGav
in interface TychoRepositoryIndex
#save()}
public void save() throws java.io.IOException
TychoRepositoryIndex
TychoRepositoryIndex.addGav(GAV)
, TychoRepositoryIndex.removeGav(GAV)
will only be reflected
in the memory state of the index. In case the index is bound some persistence location (e.g.
a file see FileBasedTychoRepositoryIndex#createArtifactsIndex(java.io.File)
) the
method will store the current memory content to the persistence storage.save
in interface TychoRepositoryIndex
java.io.IOException
private void reconcile() throws java.io.IOException
java.io.IOException
private void write(java.io.OutputStream outStream) throws java.io.IOException
java.io.IOException
private java.util.Set<GAV> read(java.io.InputStream inStream) throws java.io.IOException
java.io.IOException
public static TychoRepositoryIndex createMetadataIndex(java.io.File basedir, FileLockService fileLockService, MavenLogger logger)
public static TychoRepositoryIndex createArtifactsIndex(java.io.File basedir, FileLockService fileLockService, MavenLogger logger)