fr.paris.lutece.util.httpaccess
Class MemoryFileItem

java.lang.Object
  extended by fr.paris.lutece.util.httpaccess.MemoryFileItem
All Implemented Interfaces:
java.io.Serializable, org.apache.commons.fileupload.FileItem

public class MemoryFileItem
extends java.lang.Object
implements org.apache.commons.fileupload.FileItem

MemoryFileItem

See Also:
Serialized Form

Constructor Summary
MemoryFileItem(byte[] data, java.lang.String strName, long lSize, java.lang.String strContentType)
          Constructor
 
Method Summary
 void delete()
          
 byte[] get()
          
 java.lang.String getContentType()
          
 java.lang.String getFieldName()
          Not supported
 java.io.InputStream getInputStream()
          
 java.lang.String getName()
          
 java.io.OutputStream getOutputStream()
          
 long getSize()
          
 java.lang.String getString()
          
 java.lang.String getString(java.lang.String strEncoding)
          
 boolean isFormField()
          
 boolean isInMemory()
          
 void setFieldName(java.lang.String strFieldName)
          
 void setFormField(boolean state)
          
 void write(java.io.File file)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryFileItem

public MemoryFileItem(byte[] data,
                      java.lang.String strName,
                      long lSize,
                      java.lang.String strContentType)
Constructor

Parameters:
data - the data
strName - the file name
lSize - the size of the file
strContentType - the content type of the file
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 java.lang.String getContentType()

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

getFieldName

public java.lang.String getFieldName()
Not supported

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

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException

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

getName

public java.lang.String getName()

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

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException

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

getSize

public long getSize()

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

getString

public java.lang.String getString()

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

getString

public java.lang.String getString(java.lang.String strEncoding)
                           throws java.io.UnsupportedEncodingException

Specified by:
getString in interface org.apache.commons.fileupload.FileItem
Throws:
java.io.UnsupportedEncodingException

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(java.lang.String strFieldName)

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

setFormField

public void setFormField(boolean state)

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

write

public void write(java.io.File file)
           throws java.lang.Exception

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


Copyright © 2012 Mairie de Paris. All Rights Reserved.