fr.paris.lutece.plugins.genericattributes.business
Class GenAttFileItem

java.lang.Object
  extended by fr.paris.lutece.plugins.genericattributes.business.GenAttFileItem
All Implemented Interfaces:
Serializable, org.apache.commons.fileupload.FileItem

public class GenAttFileItem
extends Object
implements org.apache.commons.fileupload.FileItem

GenAttFileItem : builds a new fileItem

See Also:
Serialized Form

Constructor Summary
GenAttFileItem(byte[] bValue, String strFileName)
          Creates a new file item
GenAttFileItem(byte[] bValue, String strFileName, int nIdResponse)
          Creates a new file item
GenAttFileItem(byte[] bValue, String strFileName, String strFieldName, int nIdResponse)
          Creates a new file item
 
Method Summary
 void delete()
          
 byte[] get()
          
 String getContentType()
          
 String getFieldName()
          
 int getIdResponse()
          Get the id of the associated response, if any
 InputStream getInputStream()
          
 String getName()
          
 OutputStream getOutputStream()
          
 long getSize()
          
 String getString()
          
 String getString(String encoding)
          
 boolean isFormField()
          
 boolean isInMemory()
          
 void setFieldName(String strName)
          
 void setFormField(boolean bState)
          
 void setIdResponse(int nIdResponse)
          Set the id of the associated response, if any
 void write(File file)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenAttFileItem

public GenAttFileItem(byte[] bValue,
                      String strFileName)
Creates a new file item

Parameters:
bValue - the byte value
strFileName - the file name

GenAttFileItem

public GenAttFileItem(byte[] bValue,
                      String strFileName,
                      int nIdResponse)
Creates a new file item

Parameters:
bValue - the byte value
strFileName - the file name
nIdResponse - The id of the response associated with this file item if any

GenAttFileItem

public GenAttFileItem(byte[] bValue,
                      String strFileName,
                      String strFieldName,
                      int nIdResponse)
Creates a new file item

Parameters:
bValue - the byte value
strFileName - the file name
strFieldName - The name of the HTML field associated with this file, if any
nIdResponse - The id of the response associated with this file item if any
Method Detail

delete

public void delete()

Specified by:
delete in interface org.apache.commons.fileupload.FileItem

get

public byte[] get()

Specified by:
get in interface org.apache.commons.fileupload.FileItem

getContentType

public String getContentType()

Specified by:
getContentType in interface org.apache.commons.fileupload.FileItem

getFieldName

public String getFieldName()

Specified by:
getFieldName in interface org.apache.commons.fileupload.FileItem

getInputStream

public InputStream getInputStream()
                           throws IOException

Specified by:
getInputStream in interface org.apache.commons.fileupload.FileItem
Throws:
IOException

getName

public String getName()

Specified by:
getName in interface org.apache.commons.fileupload.FileItem

getOutputStream

public OutputStream getOutputStream()
                             throws IOException

Specified by:
getOutputStream in interface org.apache.commons.fileupload.FileItem
Throws:
IOException

getSize

public long getSize()

Specified by:
getSize in interface org.apache.commons.fileupload.FileItem

getString

public String getString()

Specified by:
getString in interface org.apache.commons.fileupload.FileItem

getString

public String getString(String encoding)
                 throws UnsupportedEncodingException

Specified by:
getString in interface org.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:
isFormField in interface org.apache.commons.fileupload.FileItem

isInMemory

public boolean isInMemory()

Specified by:
isInMemory in interface org.apache.commons.fileupload.FileItem

setFieldName

public void setFieldName(String strName)

Specified by:
setFieldName in interface org.apache.commons.fileupload.FileItem

setFormField

public void setFormField(boolean bState)

Specified by:
setFormField in interface org.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

write

public void write(File file)
           throws Exception

Specified by:
write in interface org.apache.commons.fileupload.FileItem
Throws:
Exception


Copyright © 2014 Mairie de Paris. All Rights Reserved.