Class UploadedFile

    • Constructor Detail

      • UploadedFile

        public UploadedFile()
        Default constructor.
    • Method Detail

      • 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 return false.

      • getContentType

        public String getContentType()
        Gets the content type of this file.
        Returns:
        the content type of this file or null if not available.
      • getName

        public String 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() returns false.
      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        Gets the content of this file as an InputStream. This method throws an error if isLoaded() returns false.
        Returns:
        The content of this file as an InputStream.
        Throws:
        IOException - if an error occurs.