Class FileBasedTychoRepositoryIndex
- java.lang.Object
-
- org.eclipse.tycho.repository.local.index.FileBasedTychoRepositoryIndex
-
- All Implemented Interfaces:
TychoRepositoryIndex
public class FileBasedTychoRepositoryIndex extends Object implements TychoRepositoryIndex
Simplistic local Maven repository index to allow efficient lookup of all installed Tycho projects. The content is persisted in a local file.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARTIFACTS_INDEX_RELPATH
static String
METADATA_INDEX_RELPATH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGav(GAV gav)
Adds a GAV to the indexstatic TychoRepositoryIndex
createArtifactsIndex(File basedir, FileLockService fileLockService, MavenLogger logger)
static TychoRepositoryIndex
createMetadataIndex(File basedir, FileLockService fileLockService, MavenLogger logger)
Set<GAV>
getProjectGAVs()
Receive the set of GAVs contained in this indexvoid
removeGav(GAV gav)
Remove a GAV from the index.void
save()
Changes performed viaTychoRepositoryIndex.addGav(GAV)
,TychoRepositoryIndex.removeGav(GAV)
will only be reflected in the memory state of the index.
-
-
-
Field Detail
-
ARTIFACTS_INDEX_RELPATH
public static final String ARTIFACTS_INDEX_RELPATH
- See Also:
- Constant Field Values
-
METADATA_INDEX_RELPATH
public static final String METADATA_INDEX_RELPATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProjectGAVs
public Set<GAV> getProjectGAVs()
Description copied from interface:TychoRepositoryIndex
Receive the set of GAVs contained in this index- Specified by:
getProjectGAVs
in interfaceTychoRepositoryIndex
- Returns:
- an unmodifiable defensive copy of the GAV set contained in this index
-
addGav
public void addGav(GAV gav)
Description copied from interface:TychoRepositoryIndex
Adds a GAV to the index- Specified by:
addGav
in interfaceTychoRepositoryIndex
- Parameters:
gav
- notnull
-
removeGav
public void removeGav(GAV gav)
Description copied from interface:TychoRepositoryIndex
Remove a GAV from the index.- Specified by:
removeGav
in interfaceTychoRepositoryIndex
-
save
public void save() throws IOException
Description copied from interface:TychoRepositoryIndex
Changes performed viaTychoRepositoryIndex.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 seeFileBasedTychoRepositoryIndex#createArtifactsIndex(java.io.File)
) the method will store the current memory content to the persistence storage.- Specified by:
save
in interfaceTychoRepositoryIndex
- Throws:
IOException
-
createMetadataIndex
public static TychoRepositoryIndex createMetadataIndex(File basedir, FileLockService fileLockService, MavenLogger logger)
-
createArtifactsIndex
public static TychoRepositoryIndex createArtifactsIndex(File basedir, FileLockService fileLockService, MavenLogger logger)
-
-