public static class

MultipartRequest.File

extends Object
implements PostedFile
java.lang.Object
   ↳ com.microstrategy.web.platform.MultipartRequest.File

Class Overview

The class MultipartRequest.File encapsulates uploaded files. Objects of this class are the values of file parameters. This implementation saves the data as temporary files in the directory specified by the system property java.io.tmpdir.

Summary

Public Methods
InputStream getInputStream()
Gets an input stream to read the contents of this object.
long getLength()
Gets the length of this file.
String getName()
Gets the original file name, as sent by the request.
String getType()
Gets the MIME type of the file, as sent by the client.
void release()
Releases any resources held by this MultipartRequest.File.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.platform.PostedFile

Public Methods

public InputStream getInputStream ()

Gets an input stream to read the contents of this object. The input stream returned by a previous call to getInputStream(), if any, is automatically closed.

Returns
  • an input stream to read this object's contents
Throws
IOException if an error occurs while opening the input stream

public long getLength ()

Gets the length of this file.

Returns
  • the length of this file

public String getName ()

Gets the original file name, as sent by the request. Notice that the file name depends on the client's platform.

Returns
  • the original file name

public String getType ()

Gets the MIME type of the file, as sent by the client. Notice that, since MIME types are case insensitive, the type is always returned in lowercase.

Returns
  • the MIME type of the file or an empty string if the type is not known

public void release ()

Releases any resources held by this MultipartRequest.File. After calling release this object is not valid anymore.

Throws
IOException if an error occurs while closing any opened streams or deleting the temporary file