Class InternalFileFossDatastore

java.lang.Object
uk.yetanother.dependency.report.datastore.InternalFileFossDatastore
All Implemented Interfaces:
IFossDatastore

public class InternalFileFossDatastore extends Object implements IFossDatastore
The FOSS Datastore implementation that holds the data as a CSV file within the filesystem.
  • Constructor Details

    • InternalFileFossDatastore

      public InternalFileFossDatastore(org.apache.maven.plugin.logging.Log logger) throws org.apache.maven.plugin.MojoExecutionException
      Instantiates a new Internal file FOSS datastore.
      Parameters:
      logger - the logger
      Throws:
      org.apache.maven.plugin.MojoExecutionException
  • Method Details

    • getDatastoreLocation

      public static Path getDatastoreLocation() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getAdditionalAttributeHeadings

      public String[] getAdditionalAttributeHeadings()
      Description copied from interface: IFossDatastore
      Get additional attribute headings that have been provided and need to be added to the basic report.
      Specified by:
      getAdditionalAttributeHeadings in interface IFossDatastore
      Returns:
      the string [ ] of the additional headings in the ordered provided
    • getAdditionalAttributesForFossItem

      public String[] getAdditionalAttributesForFossItem(String fossId)
      Description copied from interface: IFossDatastore
      Get additional attributes for FOSS item. Based on the FOSS Id ID provided lookup in the datastore for additional details held.
      Specified by:
      getAdditionalAttributesForFossItem in interface IFossDatastore
      Parameters:
      fossId - the FOSS item id
      Returns:
      the string [ ] returns the additional attributes in the same order as the additional headings or an array of null strings if the datastore does not have any more details for this FOSS item.
    • createDatastore

      public void createDatastore(Path fileToLoad) throws org.apache.maven.plugin.MojoExecutionException
      Description copied from interface: IFossDatastore
      Creates the datastore using the data in the provided datafile. If a datastore already exists it will be replaced.
      Specified by:
      createDatastore in interface IFossDatastore
      Parameters:
      fileToLoad - the datafile to use
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • updateDatastore

      public void updateDatastore(Path fileToLoad, boolean overrideExisting) throws org.apache.maven.plugin.MojoExecutionException
      Description copied from interface: IFossDatastore
      Updates the datastore using. the data in the provided datafile. This maintains existing datastore and add or updates data to it.
      Specified by:
      updateDatastore in interface IFossDatastore
      Parameters:
      fileToLoad - the datafile to use
      overrideExisting - whether to update existing datastore records with the data in the provided datafile or not.
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • clearDatastore

      public boolean clearDatastore() throws org.apache.maven.plugin.MojoExecutionException
      Description copied from interface: IFossDatastore
      Clears the datastore, completely removing any additional data the plugin held.
      Specified by:
      clearDatastore in interface IFossDatastore
      Returns:
      whether the datastore was deleted or not
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • isDatastoreEmpty

      public boolean isDatastoreEmpty()
      Description copied from interface: IFossDatastore
      Is datastore empty.
      Specified by:
      isDatastoreEmpty in interface IFossDatastore
      Returns:
      true if the datastore is empty or not initialized, false if not.