com.buschmais.jqassistant.plugin.m2repo.impl.scanner

## Class MavenIndex

- java.lang.Object
- - com.buschmais.jqassistant.plugin.m2repo.impl.scanner.MavenIndex

-     public class MavenIndex
      extends Object

  This class downloads and updates the remote maven index.
  Author:
    pherklotz

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MavenIndex(URL repoUrl, File indexDirectory, String username, String password)` Constructs a new object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeCurrentIndexingContext()`
    `void` | `closeIndexSearcher(org.apache.lucene.search.IndexSearcher searcher)` Releases the `IndexSearcher` instance.
    `Iterable<org.apache.maven.index.ArtifactInfo>` | `getArtifactsSince(Date startDate)`
    `org.apache.maven.index.context.IndexingContext` | `getIndexingContext()` Returns the actual `IndexingContext`.
    `Date` | `getLastUpdateLocalRepo()` Returns a timestamp of the last local repository index update.
    `org.apache.lucene.search.IndexSearcher` | `newIndexSearcher()` Creates a new `IndexSearcher`
    `void` | `updateIndex()` Update the local index.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MavenIndex

          public MavenIndex(URL repoUrl,
                            File indexDirectory,
                            String username,
                            String password)
                     throws IOException

      Constructs a new object.
      Parameters:
        `repoUrl` - the repository url
        `indexDirectory` - the directory for local index data
      Throws:
        `IOException` - error during index creation/update

  - ### Method Detail

    - #### closeIndexSearcher

          public void closeIndexSearcher(org.apache.lucene.search.IndexSearcher searcher)
                                  throws IOException

      Releases the `IndexSearcher` instance.
      Parameters:
        `searcher` - the `IndexSearcher`
      Throws:
        `IOException`

    - #### closeCurrentIndexingContext

          public void closeCurrentIndexingContext()
                                           throws IOException

      Throws:
        `IOException`

    - #### getArtifactsSince

          public Iterable<org.apache.maven.index.ArtifactInfo> getArtifactsSince(Date startDate)
                                                                          throws IOException

      Throws:
        `IOException`

    - #### getIndexingContext

          public org.apache.maven.index.context.IndexingContext getIndexingContext()

      Returns the actual `IndexingContext`.
      Returns:
        `IndexingContext`.

    - #### getLastUpdateLocalRepo

          public Date getLastUpdateLocalRepo()

      Returns a timestamp of the last local repository index update.

    - #### newIndexSearcher

          public org.apache.lucene.search.IndexSearcher newIndexSearcher()
                                                                  throws IOException

      Creates a new `IndexSearcher`
      Returns:
        a new `IndexSearcher`
      Throws:
        `IOException`

    - #### updateIndex

          public void updateIndex()
                           throws IOException

      Update the local index.
      Parameters:
        `username` - the username for authentication (optional)
        `password` - the password for authentication (optional)
      Throws:
        `org.codehaus.plexus.component.repository.exception.ComponentLookupException`
        `IOException`

Copyright © 2015 buschmais GbR. All rights reserved.