Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.data.cpe
Class CpeIndexReader

    java.lang.Object
      org.owasp.dependencycheck.data.cpe.BaseIndex
          org.owasp.dependencycheck.data.cpe.CpeIndexReader

    public class CpeIndexReader

extends BaseIndex

Author:
  Jeremy Long (jeremy.long@owasp.org)

Constructor Summary
`CpeIndexReader()`

Method Summary
`void` | `close()` Closes the CPE Index.
`org.apache.lucene.document.Document` | `getDocument(int documentId)` Retrieves a document from the Index.
`int` | `numDocs()` Returns the number of CPE entries stored in the index.
`void` | `open()` Opens the CPE Index.
`org.apache.lucene.search.TopDocs` | `search(org.apache.lucene.search.Query query, int maxQueryResults)` Searches the index using the given query.
`org.apache.lucene.search.TopDocs` | `search(String searchString, int maxQueryResults)` Searches the index using the given search string.

Methods inherited from class org.owasp.dependencycheck.data.cpe.BaseIndex
`getDataDirectory, getDirectory, isOpen, openDirectory`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CpeIndexReader

    public CpeIndexReader()

Method Detail

### open

    public void open()
              throws IOException

  Opens the CPE Index.

  Overrides:
    `open` in class `BaseIndex`
  Throws:
    `IOException` - is thrown if an IOException occurs opening the index.

### close

    public void close()

  Closes the CPE Index.

  Overrides:
    `close` in class `BaseIndex`

### search

    public org.apache.lucene.search.TopDocs search(String searchString,
                                                   int maxQueryResults)
                                            throws org.apache.lucene.queryparser.classic.ParseException,
                                                   IOException

  Searches the index using the given search string.

  Parameters:
    `searchString` - the query text
    `maxQueryResults` - the maximum number of documents to return
  Returns:
    the TopDocs found by the search
  Throws:
    `org.apache.lucene.queryparser.classic.ParseException` - thrown when the searchString is invalid
    `IOException` - is thrown if there is an issue with the underlying Index

### search

    public org.apache.lucene.search.TopDocs search(org.apache.lucene.search.Query query,
                                                   int maxQueryResults)
                                            throws org.apache.lucene.index.CorruptIndexException,
                                                   IOException

  Searches the index using the given query.

  Parameters:
    `query` - the query used to search the index
    `maxQueryResults` - the max number of results to return
  Returns:
    the TopDocs found be the query
  Throws:
    `org.apache.lucene.index.CorruptIndexException` - thrown if the Index is corrupt
    `IOException` - thrown if there is an IOException

### getDocument

    public org.apache.lucene.document.Document getDocument(int documentId)
                                                    throws IOException

  Retrieves a document from the Index.

  Parameters:
    `documentId` - the id of the document to retrieve
  Returns:
    the Document
  Throws:
    `IOException` - thrown if there is an IOException

### numDocs

    public int numDocs()

  Returns the number of CPE entries stored in the index.

  Returns:
    the number of CPE entries stored in the index

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.