|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.admin.payload.PayloadFilesManager
public abstract class PayloadFilesManager
Manages transferred files delivered via the request or response 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.
| Nested Class Summary | |
|---|---|
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. |
| Field Summary | |
|---|---|
protected java.util.Map<java.io.File,java.lang.Long> |
dirTimestamps
|
protected java.util.logging.Logger |
logger
|
static LocalStringManagerImpl |
strings
|
| Method Summary | |
|---|---|
protected java.net.URI |
getOutputFileURI(Payload.Part part,
java.lang.String name)
|
protected java.net.URI |
getParentURI(Payload.Part part)
|
protected java.io.File |
getTargetDir()
|
protected abstract void |
postExtract(java.io.File extractedFile)
|
protected abstract void |
postProcessParts()
|
java.util.List<java.io.File> |
processParts(Payload.Inbound inboundPayload)
Returns all Files extracted from the Payload, treating each Part as a separate file. |
java.util.Map<java.io.File,java.util.Properties> |
processPartsExtended(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final LocalStringManagerImpl strings
protected final java.util.logging.Logger logger
protected final java.util.Map<java.io.File,java.lang.Long> dirTimestamps
| Method Detail |
|---|
protected java.io.File getTargetDir()
protected java.net.URI getParentURI(Payload.Part part)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionprotected abstract void postExtract(java.io.File extractedFile)
protected java.net.URI getOutputFileURI(Payload.Part part,
java.lang.String name)
throws java.io.IOException
java.io.IOException
public java.util.Map<java.io.File,java.util.Properties> processPartsExtended(Payload.Inbound inboundPayload)
throws java.lang.Exception
inboundPayload - Payload containing file data to be extracted
java.io.IOException
java.lang.Exception
public java.util.List<java.io.File> processParts(Payload.Inbound inboundPayload)
throws java.lang.Exception
inboundPayload - Payload containing file data to be extracted
java.io.IOException
java.lang.Exceptionprotected abstract void postProcessParts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||