Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.struts.upload.MultipartElement
public class MultipartElement
extends java.lang.Object
null
content type,
files have a non-null content type.
Field Summary | |
protected String |
|
protected byte[] |
|
protected File |
|
protected String |
|
protected boolean |
|
protected String |
|
protected String |
|
Constructor Summary | |
| |
| |
|
Method Summary | |
String |
|
byte[] |
|
File |
|
String |
|
String |
|
String |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected String contentType
The content type of this element.
protected byte[] data
Deprecated. This should never be used.
The element data.
protected File file
The element's data represented in a (possibly temporary) file.
protected String fileName
The element's filename, null for text elements.
protected boolean isFile
Whether or not this element is a file.
protected String name
The element name.
protected String value
The element's text value, null for file elements
public MultipartElement(String name, String value)
Constructor for a text element.
- Parameters:
name
- The name of the elementvalue
- The value of the element
public MultipartElement(String name, String fileName, String contentType, File file)
Constructor for a file element.
- Parameters:
name
- The form name of the elementfileName
- The file name of the element if this element is a filecontentType
- The content type of the element if a filefile
- The (possibly temporary) file representing this element if it's a file
public MultipartElement(String name, String fileName, String contentType, byte[] data)
Deprecated. Use the constructor that takes an File as an argument as opposed to a byte array argument, which can cause memory problems.
public String getContentType()
Retrieve the content type.
public byte[] getData()
Deprecated. Use the getFile method to get a File representing the data for this element
Retrieve the data.
public File getFile()
Get the File that holds the data for this element.
public String getFileName()
Retrieve the filename, can returnnull
for text elements.
public String getName()
Retrieve the name.
public String getValue()
Returns the value of this multipart element.
- Returns:
- A String if the element is a text element,
null
otherwise
public boolean isFile()
Is this element a file.
public void setContentType(String contentType)
Set the content type.
public void setData(byte[] data)
Deprecated. Use the setFile method to set the file that represents the data of this element
Set the data.
public void setFile(File file)
Set the file that represents this element.
public void setFileName(String fileName)
Set the file name for this element.
public void setName(String name)
Set the name for this element.
public void setValue(String value)