Class GenAttFileItem
- java.lang.Object
-
- fr.paris.lutece.plugins.genericattributes.business.GenAttFileItem
-
- All Implemented Interfaces:
org.apache.commons.fileupload.FileItem,org.apache.commons.fileupload.FileItemHeadersSupport
public class GenAttFileItem extends Object implements org.apache.commons.fileupload.FileItem
GenAttFileItem : builds a new fileItem
-
-
Constructor Summary
Constructors Constructor Description GenAttFileItem(byte[] bValue, String strFileName)Creates a new file itemGenAttFileItem(byte[] bValue, String strFileName, int nIdResponse, String strOrigin)Creates a new file itemGenAttFileItem(byte[] bValue, String strFileName, String strFieldName, int nIdResponse, String strOrigin)Creates a new file item
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()byte[]get()StringgetContentType()StringgetFieldName()org.apache.commons.fileupload.FileItemHeadersgetHeaders()intgetIdResponse()Get the id of the associated response, if anyInputStreamgetInputStream()StringgetName()StringgetOrigin()OutputStreamgetOutputStream()longgetSize()StringgetString()StringgetString(String encoding)booleanisFormField()booleanisInMemory()voidsetFieldName(String strName)voidsetFormField(boolean bState)voidsetHeaders(org.apache.commons.fileupload.FileItemHeaders headers)voidsetIdResponse(int nIdResponse)Set the id of the associated response, if anyvoidsetOrigin(String strOrigin)voidwrite(File file)
-
-
-
Constructor Detail
-
GenAttFileItem
public GenAttFileItem(byte[] bValue, String strFileName)Creates a new file item- Parameters:
bValue- the byte valuestrFileName- the file name
-
GenAttFileItem
public GenAttFileItem(byte[] bValue, String strFileName, int nIdResponse, String strOrigin)Creates a new file item- Parameters:
bValue- the byte valuestrFileName- the file namenIdResponse- The id of the response associated with this file item if any
-
GenAttFileItem
public GenAttFileItem(byte[] bValue, String strFileName, String strFieldName, int nIdResponse, String strOrigin)Creates a new file item- Parameters:
bValue- the byte valuestrFileName- the file namestrFieldName- The name of the HTML field associated with this file, if anynIdResponse- The id of the response associated with this file item if any
-
-
Method Detail
-
delete
public void delete()
- Specified by:
deletein interfaceorg.apache.commons.fileupload.FileItem
-
get
public byte[] get()
- Specified by:
getin interfaceorg.apache.commons.fileupload.FileItem
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceorg.apache.commons.fileupload.FileItem
-
getFieldName
public String getFieldName()
- Specified by:
getFieldNamein interfaceorg.apache.commons.fileupload.FileItem
-
getInputStream
public InputStream getInputStream() throws IOException
- Specified by:
getInputStreamin interfaceorg.apache.commons.fileupload.FileItem- Throws:
IOException
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.apache.commons.fileupload.FileItem
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Specified by:
getOutputStreamin interfaceorg.apache.commons.fileupload.FileItem- Throws:
IOException
-
getSize
public long getSize()
- Specified by:
getSizein interfaceorg.apache.commons.fileupload.FileItem
-
getOrigin
public String getOrigin()
-
getString
public String getString()
- Specified by:
getStringin interfaceorg.apache.commons.fileupload.FileItem
-
getString
public String getString(String encoding) throws UnsupportedEncodingException
- Specified by:
getStringin interfaceorg.apache.commons.fileupload.FileItem- Throws:
UnsupportedEncodingException
-
getIdResponse
public int getIdResponse()
Get the id of the associated response, if any- Returns:
- The id of the associated response, if any
-
isFormField
public boolean isFormField()
- Specified by:
isFormFieldin interfaceorg.apache.commons.fileupload.FileItem
-
isInMemory
public boolean isInMemory()
- Specified by:
isInMemoryin interfaceorg.apache.commons.fileupload.FileItem
-
setFieldName
public void setFieldName(String strName)
- Specified by:
setFieldNamein interfaceorg.apache.commons.fileupload.FileItem
-
setFormField
public void setFormField(boolean bState)
- Specified by:
setFormFieldin interfaceorg.apache.commons.fileupload.FileItem
-
setIdResponse
public void setIdResponse(int nIdResponse)
Set the id of the associated response, if any- Parameters:
nIdResponse- The id of the associated response, if any
-
setOrigin
public void setOrigin(String strOrigin)
-
write
public void write(File file) throws Exception
- Specified by:
writein interfaceorg.apache.commons.fileupload.FileItem- Throws:
Exception
-
getHeaders
public org.apache.commons.fileupload.FileItemHeaders getHeaders()
- Specified by:
getHeadersin interfaceorg.apache.commons.fileupload.FileItemHeadersSupport
-
setHeaders
public void setHeaders(org.apache.commons.fileupload.FileItemHeaders headers)
- Specified by:
setHeadersin interfaceorg.apache.commons.fileupload.FileItemHeadersSupport
-
-