Class PkgsImportService

java.lang.Object
org.ctan.site.services.catalogue.AbstractImportService<PkgStore>
org.ctan.site.services.catalogue.PkgsImportService

public class PkgsImportService extends AbstractImportService<PkgStore>
This service deals with the packages from a file.

The file encoding is UTF-8.

 <entry
   id="the-key"
 >
   <name>...</name>
   ...
 </entry>
 
  • The root node is entry.
  • Constructor Details

    • PkgsImportService

      public PkgsImportService(@NonNull @NonNull File entries, @NonNull @NonNull PkgStore store, @NonNull @NonNull AuthorStore authorStore, @NonNull @NonNull TopicStore topicsStore, @NonNull @NonNull LicenseStore licenseStore)
      This is the constructor for PkgsImportService.
      Parameters:
      entries - the entries directory
      store - the package store
      authorStore - the author store
      topicsStore - the topic store
      licenseStore - the license store
  • Method Details

    • drop

      public void drop(List<Pkg> pkgsToBeDropped)
      The method drop provides means to drop some packages.
      Parameters:
      pkgsToBeDropped - the packages to be dropped
    • updateExisting

      public List<Pkg> updateExisting() throws IOException
      The method updateExisting provides means to parse an XML file and add the entries found to the database. As a side effect a list of packages is collected which are not in the XML files.
      Returns:
      the packages to be dropped
      Throws:
      IOException - in case of an I/O error