Class PendingExportService
Pending export files are only accessible by the user who created them. They expire after a short period of time and are automatically deleted if not consumed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a pending export file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(InputStream stream) Adds a pending export file for the current user.add(InputStream stream, String fileName) Adds a pending export file for the current user.add(InputStream stream, String fileName, boolean download) Adds a pending export file for the current user.Adds a pending export file for the current user.Returns the pending export file by its token.Removes and returns the pending export file by its token.
-
Constructor Details
-
PendingExportService
public PendingExportService()
-
-
Method Details
-
add
Adds a pending export file for the current user.Creates a temporary file from the given stream and returns the token associated with it.
- Parameters:
stream- the stream to the export file- Returns:
- the token associated with the pending export file
-
add
Adds a pending export file for the current user.Creates a temporary file from the given stream and returns the token associated with it.
- Parameters:
stream- the stream to the export filefileName- the name of the export file, or null- Returns:
- the token associated with the pending export file
-
add
Adds a pending export file for the current user.Creates a temporary file from the given stream and returns the token associated with it.
- Parameters:
stream- the stream to the export filefileName- the name of the export file, or nulldownload- whether the client downloads the file, instead of previewing it- Returns:
- the token associated with the pending export file
-
add
Adds a pending export file for the current user.Returns the token associated with the given local file. The file is used as is if located in the temporary directory; otherwise, a temporary file is created from it.
- Parameters:
file- the local export file- Returns:
- the token associated with the pending export file
-
get
Returns the pending export file by its token.The pending export file is not consumed, and can be retrieved again until it expires.
- Parameters:
token- the token associated with the pending export file- Returns:
- the pending export file, or null if not found, not created by the current user, or its file is missing
-
remove
Removes and returns the pending export file by its token.It is your responsibility to delete the export file after you're done with it.
- Parameters:
token- the token associated with the pending export file- Returns:
- the pending export file, or null if not found, not created by the current user, or its file is missing
-