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 voidcopy(OutputStream os)Copies the contents of the Part to the specified OutputStream.StringgetContentType()Returns the content type of the part.FilegetExtracted()File where content was extracted from the payload.protected InputStreamgetExtractedInputStream()StringgetName()Returns the name assigned to the part when it was created.PropertiesgetProperties()Returns the Properties associated with the Part.booleanisRecursive()Indicates if the Part represents a recursive action or not.static PayloadImpl.PartnewInstance(String contentType, String name, Properties props, File file)Creates a new Part from a File.static PayloadImpl.PartnewInstance(String contentType, String name, Properties props, InputStream is)Creates a new Part from an InputStream.static PayloadImpl.PartnewInstance(String contentType, String name, Properties props, String content)Creates a new Part from a String.voidsetExtracted(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.PartReturns the name assigned to the part when it was created.- Specified by:
getNamein interfacePayload.Part- Returns:
- name
-
getContentType
public String getContentType()
Description copied from interface:Payload.PartReturns the content type of the part.- Specified by:
getContentTypein interfacePayload.Part- Returns:
- content type
-
getProperties
public Properties getProperties()
Description copied from interface:Payload.PartReturns the Properties associated with the Part.- Specified by:
getPropertiesin interfacePayload.Part- Returns:
- Properties for the Part
-
isRecursive
public boolean isRecursive()
Description copied from interface:Payload.PartIndicates if the Part represents a recursive action or not.- Specified by:
isRecursivein 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:
setExtractedin interfacePayload.Part
-
getExtracted
public File getExtracted()
Description copied from interface:Payload.PartFile where content was extracted from the payload.- Specified by:
getExtractedin 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.PartCopies the contents of the Part to the specified OutputStream.- Specified by:
copyin interfacePayload.Part- Parameters:
os- target OutputStream to receive the content of the Part- Throws:
IOException
-
-