Package com.microstrategy.web.platform
Class MultipartRequest.File
- java.lang.Object
-
- com.microstrategy.web.platform.MultipartRequest.File
-
- All Implemented Interfaces:
PostedFile
- Enclosing class:
- MultipartRequest
public static class MultipartRequest.File extends java.lang.Object implements PostedFile
The classMultipartRequest.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 propertyjava.io.tmpdir
.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getInputStream()
Gets an input stream to read the contents of this object.long
getLength()
Gets the length of this file.java.lang.String
getName()
Gets the original file name, as sent by the request.java.lang.String
getType()
Gets the MIME type of the file, as sent by the client.void
release()
Releases any resources held by thisMultipartRequest.File
.
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Gets an input stream to read the contents of this object. The input stream returned by a previous call togetInputStream()
, if any, is automatically closed.- Specified by:
getInputStream
in interfacePostedFile
- Returns:
- an input stream to read this object's contents
- Throws:
java.io.IOException
- if an error occurs while opening the input stream
-
getLength
public long getLength()
Gets the length of this file.- Specified by:
getLength
in interfacePostedFile
- Returns:
- the length of this file
-
getName
public java.lang.String getName()
Gets the original file name, as sent by the request. Notice that the file name depends on the client's platform.- Specified by:
getName
in interfacePostedFile
- Returns:
- the original file name
-
getType
public java.lang.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.- Specified by:
getType
in interfacePostedFile
- Returns:
- the MIME type of the file or an empty string if the type is not known
-
release
public void release() throws java.io.IOException
Releases any resources held by thisMultipartRequest.File
. After callingrelease
this object is not valid anymore.- Specified by:
release
in interfacePostedFile
- Throws:
java.io.IOException
- if an error occurs while closing any opened streams or deleting the temporary file
-
-