Class UploadedFile
java.lang.Object
com.orchestranetworks.schema.types.file.UploadedFile
This class represents an uploaded file.
- Since:
- 5.8.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deletes the underlying storage for this file.Gets the content type of this file.Gets the content of this file as an InputStream.getName()
Returns the original file name in the client's file system, as provided by the browser.long
getSize()
Returns the size of this file.boolean
isLoaded()
Returns true if a file is loaded.
-
Constructor Details
-
UploadedFile
public UploadedFile()Default constructor.
-
-
Method Details
-
isLoaded
public boolean isLoaded()Returns true if a file is loaded.- Returns:
true
if and only if a file is available.
-
clear
public void clear()Deletes the underlying storage for this file. Although this storage will eventually be deleted automatically, for example when a user service closes, this method can be used to ensure that this is done at an earlier time, thus preserving system resources.After calling this method,
isLoaded()
will always returnfalse
. -
getContentType
Gets the content type of this file.- Returns:
- the content type of this file or
null
if not available.
-
getName
Returns the original file name in the client's file system, as provided by the browser.- Returns:
- the name of the file or
null
if not available.
-
getSize
public long getSize()Returns the size of this file.- Returns:
- the size, in bytes, of the file or 0 if
isLoaded()
returnsfalse
.
-
getInputStream
Gets the content of this file as an InputStream. This method throws an error ifisLoaded()
returnsfalse
.- Returns:
- The content of this file as an InputStream.
- Throws:
IOException
- if an error occurs.
-