Package org.silverpeas.core.io.upload
Class UploadSessionFile
- java.lang.Object
-
- org.silverpeas.core.io.upload.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 anUploadSession
instance.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFullPath()
Gets the full path of this file relative to the root folder of the underlying files upload session.File
getServerFile()
Gets the physical representation on the server filesystem of this file.UploadSession
getUploadSession()
Gets the files upload session for which this file is defined.void
write(InputStream uploadedInputStream)
Writes the given input stream into the physical file referred by thegetServerFile()
method.
Closes the input stream at the end.
-
-
-
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 thegetServerFile()
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.
-
-