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.Fileencapsulates 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.InputStreamgetInputStream()Gets an input stream to read the contents of this object.longgetLength()Gets the length of this file.java.lang.StringgetName()Gets the original file name, as sent by the request.java.lang.StringgetType()Gets the MIME type of the file, as sent by the client.voidrelease()Releases any resources held by thisMultipartRequest.File.
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionGets 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:
getInputStreamin 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:
getLengthin 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:
getNamein 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:
getTypein 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.IOExceptionReleases any resources held by thisMultipartRequest.File. After callingreleasethis object is not valid anymore.- Specified by:
releasein interfacePostedFile- Throws:
java.io.IOException- if an error occurs while closing any opened streams or deleting the temporary file
-
-