Class UploadService

java.lang.Object
org.ctan.site.services.upload.UploadService

public class UploadService extends Object
The class UploadService contains the service to access the incoming directory.
  • Constructor Details

    • UploadService

      public UploadService(@NonNull @NonNull CtanConfiguration.UploadConfig config, @NonNull @NonNull UploadStore uploadStore)
      This is the constructor for the class UploadService.
      Parameters:
      config - the CTAN configuration
      uploadStore - the underlying store
  • Method Details

    • getAddendum

      public Map<String,String> getAddendum() throws IOException
      The method getAddendum provides means to retrieve the addendum file.
      Returns:
      the addendum
      Throws:
      IOException - in case of an I/O error
    • getList

      @GET @Path("/list") public UploadService.IncomingTo getList(@QueryParam("page") long page, @QueryParam("size") long size) throws FileNotFoundException
      The method getList provides means to retrieve the list of unprocessed packages. The packages are taken from the incoming directory in the configuration.

      The list is paged. Thus several segments can be requested.

      Directories starting with a dot are silently ignored.

      Parameters:
      page - the current page
      size - the page size
      Returns:
      the list of current uploads
      Throws:
      FileNotFoundException - in case that the incoming directory does not exist
    • getStatistics

      public Map<String,Integer> getStatistics()
      The method getStatistics provides means to retrieve the cached upload statistics. The upload statistics contains the number of uploads per month.

      The statistics are cached and updated every 30 minutes.

      Returns:
      the statistics
    • save

      public Upload save(Upload upload)
      The method save provides means to store an entity.
      Parameters:
      upload - the entity
      Returns:
      the entity