Class SessionMultipartItem

java.lang.Object
fr.paris.lutece.plugins.asynchronousupload.service.SessionMultipartItem
All Implemented Interfaces:
fr.paris.lutece.portal.service.upload.MultipartItem, Serializable

public class SessionMultipartItem extends Object implements fr.paris.lutece.portal.service.upload.MultipartItem, Serializable
Uploaded file kept in the HTTP session. The file stays where the upload put it (usually a temporary file).
  • One instance: its content is only copied when the session is serialized.
  • Several instances (IUploadedFileStore.isActive()): its content is written once, at upload, to the store shared by the instances, and the session only keeps its id. The session is written to the shared session store after each request that reads it: the file is not written again each time.
See Also:
  • Constructor Details

    • SessionMultipartItem

      public SessionMultipartItem(fr.paris.lutece.portal.service.upload.MultipartItem item)
      Constructor
      Parameters:
      item - the uploaded item
  • Method Details

    • of

      public static fr.paris.lutece.portal.service.upload.MultipartItem of(fr.paris.lutece.portal.service.upload.MultipartItem item)
      Wraps an item unless it is already kept in the session
      Parameters:
      item - the item
      Returns:
      the item to keep in the session
    • getFieldName

      public String getFieldName()
      Specified by:
      getFieldName in interface fr.paris.lutece.portal.service.upload.MultipartItem
    • getName

      public String getName()
      Specified by:
      getName in interface fr.paris.lutece.portal.service.upload.MultipartItem
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface fr.paris.lutece.portal.service.upload.MultipartItem
    • getSize

      public long getSize()
      Specified by:
      getSize in interface fr.paris.lutece.portal.service.upload.MultipartItem
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface fr.paris.lutece.portal.service.upload.MultipartItem
      Throws:
      IOException
    • get

      public byte[] get() throws UncheckedIOException
      Specified by:
      get in interface fr.paris.lutece.portal.service.upload.MultipartItem
      Throws:
      UncheckedIOException
    • delete

      public void delete() throws IOException
      Specified by:
      delete in interface fr.paris.lutece.portal.service.upload.MultipartItem
      Throws:
      IOException