Package org.glassfish.admin.payload
Class PayloadImpl.Part
- java.lang.Object
-
- org.glassfish.admin.payload.PayloadImpl.Part
-
- All Implemented Interfaces:
Payload.Part
- Enclosing class:
- PayloadImpl
public abstract static class PayloadImpl.Part extends Object implements Payload.Part
Partial implementation of Part.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copy(OutputStream os)
Copies the contents of the Part to the specified OutputStream.String
getContentType()
Returns the content type of the part.File
getExtracted()
File where content was extracted from the payload.protected InputStream
getExtractedInputStream()
String
getName()
Returns the name assigned to the part when it was created.Properties
getProperties()
Returns the Properties associated with the Part.boolean
isRecursive()
Indicates if the Part represents a recursive action or not.static PayloadImpl.Part
newInstance(String contentType, String name, Properties props, File file)
Creates a new Part from a File.static PayloadImpl.Part
newInstance(String contentType, String name, Properties props, InputStream is)
Creates a new Part from an InputStream.static PayloadImpl.Part
newInstance(String contentType, String name, Properties props, String content)
Creates a new Part from a String.void
setExtracted(File extractedFile)
Some use cases need reentrantable implementation of this stream implementation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.api.admin.Payload.Part
getInputStream
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Payload.Part
Returns the name assigned to the part when it was created.- Specified by:
getName
in interfacePayload.Part
- Returns:
- name
-
getContentType
public String getContentType()
Description copied from interface:Payload.Part
Returns the content type of the part.- Specified by:
getContentType
in interfacePayload.Part
- Returns:
- content type
-
getProperties
public Properties getProperties()
Description copied from interface:Payload.Part
Returns the Properties associated with the Part.- Specified by:
getProperties
in interfacePayload.Part
- Returns:
- Properties for the Part
-
isRecursive
public boolean isRecursive()
Description copied from interface:Payload.Part
Indicates if the Part represents a recursive action or not.- Specified by:
isRecursive
in interfacePayload.Part
- Returns:
-
setExtracted
public void setExtracted(File extractedFile)
Some use cases need reentrantable implementation of this stream implementation. Information about extraction can be used for it.- Specified by:
setExtracted
in interfacePayload.Part
-
getExtracted
public File getExtracted()
Description copied from interface:Payload.Part
File where content was extracted from the payload.- Specified by:
getExtracted
in interfacePayload.Part
-
getExtractedInputStream
protected InputStream getExtractedInputStream()
-
newInstance
public static PayloadImpl.Part newInstance(String contentType, String name, Properties props, InputStream is)
Creates a new Part from an InputStream.- Parameters:
contentType
- content type for the Partname
- name of the Partprops
- Properties to be associated with the Partis
- InputStream to be used to populate the Part's data- Returns:
- the new Part
-
newInstance
public static PayloadImpl.Part newInstance(String contentType, String name, Properties props, String content)
Creates a new Part from a String.- Parameters:
contentType
- content type for the Partname
- name of the Partprops
- Properties to be associated with the Partcontent
- String containing the content for the Part- Returns:
-
newInstance
public static PayloadImpl.Part newInstance(String contentType, String name, Properties props, File file) throws FileNotFoundException
Creates a new Part from a File.- Parameters:
contentType
- content type for the Partname
- name of the Partprops
- Properties to be associated with the Partfile
- File containing the content for the Part- Returns:
- Throws:
FileNotFoundException
-
copy
public void copy(OutputStream os) throws IOException
Description copied from interface:Payload.Part
Copies the contents of the Part to the specified OutputStream.- Specified by:
copy
in interfacePayload.Part
- Parameters:
os
- target OutputStream to receive the content of the Part- Throws:
IOException
-
-