Class UploadSessionFile


  • public class UploadSessionFile
    extends Object
    This class represents a file which will be uploaded, or, has been uploaded, on the server within the context of a files upload session (represented by an UploadSession instance.
    Author:
    Yohann Chastagnier
    • Method Detail

      • getUploadSession

        public UploadSession getUploadSession()
        Gets the files upload session for which this file is defined.
        Returns:
        the UploadSession instance to which this file belongs.
      • getFullPath

        public String getFullPath()
        Gets the full path of this file relative to the root folder of the underlying files upload session.
        Returns:
        the path of the file relative to the upload session's root folder.
      • getServerFile

        public File getServerFile()
        Gets the physical representation on the server filesystem of this file.
        Returns:
        the file on the Silverpeas server.
      • write

        public void write​(InputStream uploadedInputStream)
                   throws IOException
        Writes the given input stream into the physical file referred by the getServerFile() method.
        Closes the input stream at the end.
        Parameters:
        uploadedInputStream - an input stream on a content to read.
        Throws:
        IOException - if an error occurs while reading the input stream and writing the content onto the physical file.