public abstract class PayloadFilesManager extends Object
Payload.
Callers can process the entire payload
at once, treating each Part as a file, using the processParts(org.glassfish.api.admin.Payload.Inbound)
method. Or, the caller can invoke the #processPart
method to work with a single Part as a file.
If the caller wants to extract the payload's content as temporary files it should
instantiate PayloadFilesManager.Temp which exposes a PayLoadFilesManager.Temp#cleanup
method. The caller should invoke this method once it has finished with
the transferred files, although the finalizer will invoke cleanup just in case.
On the other hand, if the caller wants to keep the transferred files it
should instantiate PayloadFilesManager.Perm.
Temp uses a unique temporary directory, then creates one
temp file for each part it is asked to deal with, either from an entire payload
(processParts(org.glassfish.api.admin.Payload.Inbound)) or a
single part (#processPart(org.glassfish.api.admin.Payload.Part)). Recall that each part in the
payload has a name which is a relative or absolute URI.
| Modifier and Type | Class and Description |
|---|---|
static interface |
PayloadFilesManager.ActionReportHandler |
static class |
PayloadFilesManager.Perm
Extracts files from a Payload and leaves them on disk.
|
static class |
PayloadFilesManager.Temp
Extracts files from a payload, treating them as temporary files.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<File,Long> |
dirTimestamps |
protected Logger |
logger |
static LocalStringManagerImpl |
strings |
| Modifier and Type | Method and Description |
|---|---|
protected URI |
getOutputFileURI(org.glassfish.api.admin.Payload.Part part,
String name) |
protected URI |
getParentURI(org.glassfish.api.admin.Payload.Part part) |
protected File |
getTargetDir() |
protected abstract void |
postExtract(File extractedFile) |
protected abstract void |
postProcessParts() |
List<File> |
processParts(org.glassfish.api.admin.Payload.Inbound inboundPayload)
Returns all Files extracted from the Payload, treating each Part as a
separate file.
|
Map<File,Properties> |
processPartsExtended(org.glassfish.api.admin.Payload.Inbound inboundPayload)
Returns all Files extracted from the Payload, treating each Part as a
separate file, via a Map from each File to its associated Properties.
|
public static final LocalStringManagerImpl strings
protected final Logger logger
protected File getTargetDir()
protected URI getParentURI(org.glassfish.api.admin.Payload.Part part) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected abstract void postExtract(File extractedFile)
protected URI getOutputFileURI(org.glassfish.api.admin.Payload.Part part, String name) throws IOException
IOExceptionpublic Map<File,Properties> processPartsExtended(org.glassfish.api.admin.Payload.Inbound inboundPayload) throws Exception
inboundPayload - Payload containing file data to be extractedIOExceptionExceptionpublic List<File> processParts(org.glassfish.api.admin.Payload.Inbound inboundPayload) throws Exception
inboundPayload - Payload containing file data to be extractedIOExceptionExceptionprotected abstract void postProcessParts()
Copyright © 2017–2020 Eclipse Foundation. All rights reserved.