Package org.ctan.site.services.upload
Class UploadService
java.lang.Object
org.ctan.site.services.upload.UploadService
The class
UploadService
contains the service to access the
incoming directory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The classIncomingTo
contains the transport object for the paged list of incoming files. -
Constructor Summary
ConstructorsConstructorDescriptionUploadService
(@NonNull CtanConfiguration.UploadConfig config, @NonNull UploadStore uploadStore) This is the constructor for the classUploadService
. -
Method Summary
Modifier and TypeMethodDescriptionThe methodgetAddendum
provides means to retrieve the addendum file.getList
(long page, long size) The methodgetList
provides means to retrieve the list of unprocessed packages.The methodgetStatistics
provides means to retrieve the cached upload statistics.The methodsave
provides means to store an entity.
-
Constructor Details
-
UploadService
public UploadService(@NonNull @NonNull CtanConfiguration.UploadConfig config, @NonNull @NonNull UploadStore uploadStore) This is the constructor for the classUploadService
.- Parameters:
config
- the CTAN configurationuploadStore
- the underlying store
-
-
Method Details
-
getAddendum
The methodgetAddendum
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 methodgetList
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 pagesize
- the page size- Returns:
- the list of current uploads
- Throws:
FileNotFoundException
- in case that the incoming directory does not exist
-
getStatistics
The methodgetStatistics
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
The methodsave
provides means to store an entity.- Parameters:
upload
- the entity- Returns:
- the entity
-