Class DownloadResource
java.lang.Object
io.goobi.viewer.api.rest.v1.downloads.DownloadResource
DownloadResource class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRemove all jobs from the database.Remove a download job from the database.deleteEPUBDownloadJob
(String pi, String logId) Remove a download job from the database.Remove all jobs of a type from the database.Remove a download job from the database.deletePDFDownloadJob
(String pi, String logId) Remove a download job from the database.Remove all jobs of a type from the database.Get information about all download jobs of a type.Get information about all download jobs of a type.Get information about a specific downloadJob.getEPUBDownloadInfo
(String pi, String logId) Get information about a specific downloadJob.getOrCreateDownloadJob
(String pi, String inLogId, String inEmail, String type) Deprecated.Get information about a specific downloadJob.getPDFDownloadInfo
(String pi, String logId) Get information about a specific downloadJob.Get information about all download jobs of a type.putEPUBDownloadJob
(String pi, String email) putEPUBDownloadJob
(String pi, String logId, String email) putPDFDownloadJob
(String pi, String usePdfSource, String email) putPDFDownloadJob
(String pi, String logId, String usePdfSource, String email)
-
Constructor Details
-
DownloadResource
public DownloadResource()
-
-
Method Details
-
getPDFDownloadInfo
@GET @Path("/pdf/records/{pi}/sections/{divId}") @Produces("application/json") public DownloadJob getPDFDownloadInfo(@PathParam("pi") String pi, @PathParam("divId") String logId) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException Get information about a specific downloadJob.- Parameters:
pi
- The PI of the underlying recordlogId
- The logId of the underyling docStruct. Is ignored if it matches the regex [-(null)]/i- Returns:
- A json representation of the
DownloadJob
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
deletePDFDownloadJob
@DELETE @Path("/pdf/records/{pi}/sections/{divId}") @Produces("application/json") public String deletePDFDownloadJob(@PathParam("pi") String pi, @PathParam("divId") String logId) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Remove a download job from the database.- Parameters:
pi
- The PI of the underlying recordlogId
- The logId of the underyling docStruct. Is ignored if it matches the regex [-(null)]/i- Returns:
- A json object containing the job identifier and wether the job could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
putPDFDownloadJob
@PUT @Path("/pdf/records/{pi}/sections/{divId}") @Produces("application/json") public String putPDFDownloadJob(@PathParam("pi") String pi, @PathParam("divId") String logId, @QueryParam("usePdfSource") String usePdfSource, @QueryParam("email") String email) throws DAOException, URISyntaxException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
DAOException
URISyntaxException
com.fasterxml.jackson.core.JsonProcessingException
-
getPDFDownloadInfo
@GET @Path("/pdf/records/{pi}") @Produces("application/json") public DownloadJob getPDFDownloadInfo(@PathParam("pi") String pi) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException Get information about a specific downloadJob.- Parameters:
pi
-- Returns:
- A json representation of the
DownloadJob
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
deletePDFDownloadJob
@DELETE @Path("/pdf/records/{pi}") @Produces("application/json") public String deletePDFDownloadJob(@PathParam("pi") String pi) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Remove a download job from the database.- Parameters:
pi
-- Returns:
- A json object containing the job identifier and wether the job could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
putPDFDownloadJob
@PUT @Path("/pdf/records/{pi}") @Produces("application/json") public String putPDFDownloadJob(@PathParam("pi") String pi, @QueryParam("usePdfSource") String usePdfSource, @QueryParam("email") String email) throws com.fasterxml.jackson.core.JsonProcessingException, DAOException, URISyntaxException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
DAOException
URISyntaxException
-
getEPUBDownloadInfo
@GET @Path("/epub/records/{pi}/sections/{divId}") @Produces("application/json") public DownloadJob getEPUBDownloadInfo(@PathParam("pi") String pi, @PathParam("divId") String logId) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException Get information about a specific downloadJob.- Parameters:
pi
- The PI of the underlying recordlogId
- The logId of the underyling docStruct. Is ignored if it matches the regex [-(null)]/i- Returns:
- A json representation of the
DownloadJob
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
deleteEPUBDownloadJob
@DELETE @Path("/epub/records/{pi}/sections/{divId}") @Produces("application/json") public String deleteEPUBDownloadJob(@PathParam("pi") String pi, @PathParam("divId") String logId) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Remove a download job from the database.- Parameters:
pi
- The PI of the underlying recordlogId
- The logId of the underyling docStruct. Is ignored if it matches the regex [-(null)]/i- Returns:
- A json object containing the job identifier and wether the job could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
putEPUBDownloadJob
@PUT @Path("/epub/records/{pi}/sections/{divId}") @Produces("application/json") public String putEPUBDownloadJob(@PathParam("pi") String pi, @PathParam("divId") String logId, @QueryParam("email") String email) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getEPUBDownloadInfo
@GET @Path("/epub/records/{pi}") @Produces("application/json") public DownloadJob getEPUBDownloadInfo(@PathParam("pi") String pi) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException Get information about a specific downloadJob.- Parameters:
pi
-- Returns:
- A json representation of the
DownloadJob
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
- if any.
-
deleteEPUBDownloadJob
@DELETE @Path("/epub/records/{pi}") @Produces("application/json") public String deleteEPUBDownloadJob(@PathParam("pi") String pi) throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Remove a download job from the database.- Parameters:
pi
-- Returns:
- A json object containing the job identifier and wether the job could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
putEPUBDownloadJob
@PUT @Path("/epub/records/{pi}") @Produces("application/json") public String putEPUBDownloadJob(@PathParam("pi") String pi, @QueryParam("email") String email) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
getAllDownloadJobs
@GET @Produces("application/json") public List<DownloadJob> getAllDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionGet information about all download jobs of a type.- Returns:
- An array of json representations of all
DownloadJob
s of the given type - Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
deleteAllDownloadJobs
@DELETE @Produces("application/json") public List<String> deleteAllDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionRemove all jobs from the database.- Returns:
- An array of json objects containing the job identifiers and wether the jobs could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
getPDFDownloadJobs
@GET @Path("/pdf") @Produces("application/json") public List<DownloadJob> getPDFDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionGet information about all download jobs of a type.- Returns:
- An array of json representations of all
DownloadJob
s of the given type - Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
deletePDFDownloadJobs
@DELETE @Path("/pdf") @Produces("application/json") public List<String> deletePDFDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionRemove all jobs of a type from the database.- Returns:
- An array of json objects containing the job identifiers and wether the jobs could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
getDownloadJobs
@GET @Path("/epub") @Produces("application/json") public List<DownloadJob> getDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionGet information about all download jobs of a type.- Returns:
- An array of json representations of all
DownloadJob
s of the given type - Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
deleteEPUBDownloadJobs
@DELETE @Path("/epub") @Produces("application/json") public List<String> deleteEPUBDownloadJobs() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionRemove all jobs of a type from the database.- Returns:
- An array of json objects containing the job identifiers and wether the jobs could be deleted
- Throws:
DAOException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
getOrCreateDownloadJob
@Deprecated(since="24.10") public String getOrCreateDownloadJob(String pi, String inLogId, String inEmail, String type) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Deprecated.replaced byputPDFDownloadJob(String, String, String, String)
for PDFs. For EPUB this needs to be rewritten using message queue functionality analogous to the handling of PDFs- Parameters:
pi
-inLogId
-inEmail
-type
-- Returns:
- Response as JSON
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
putPDFDownloadJob(String, String, String, String)
for PDFs.