Class FileBasedTychoRepositoryIndex

  • All Implemented Interfaces:
    TychoRepositoryIndex

    public class FileBasedTychoRepositoryIndex
    extends java.lang.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 Detail

      • ARTIFACTS_INDEX_RELPATH

        public static final java.lang.String ARTIFACTS_INDEX_RELPATH
        See Also:
        Constant Field Values
      • METADATA_INDEX_RELPATH

        public static final java.lang.String METADATA_INDEX_RELPATH
        See Also:
        Constant Field Values
      • indexFile

        private final java.io.File indexFile
      • addedGavs

        private java.util.Set<GAV> addedGavs
      • removedGavs

        private java.util.Set<GAV> removedGavs
      • gavs

        private java.util.Set<GAV> gavs
    • Constructor Detail

      • FileBasedTychoRepositoryIndex

        private FileBasedTychoRepositoryIndex​(java.io.File indexFile,
                                              FileLockService fileLockService,
                                              MavenLogger logger)
    • Method Detail

      • lock

        private void lock()
      • unlock

        private void unlock()
      • getProjectGAVs

        public java.util.Set<GAV> getProjectGAVs()
        Description copied from interface: TychoRepositoryIndex
        Receive the set of GAVs contained in this index
        Specified by:
        getProjectGAVs in interface TychoRepositoryIndex
        Returns:
        an unmodifiable defensive copy of the GAV set contained in this index
      • save

        public void save()
                  throws java.io.IOException
        Description copied from interface: TychoRepositoryIndex
        Changes performed via 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.
        Specified by:
        save in interface TychoRepositoryIndex
        Throws:
        java.io.IOException
      • reconcile

        private void reconcile()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        private void write​(java.io.OutputStream outStream)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        private java.util.Set<GAV> read​(java.io.InputStream inStream)
                                 throws java.io.IOException
        Throws:
        java.io.IOException