|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.upload.UploadSession
public class UploadSession
Manage a session of file & folder upload. Each file is saved in a temporary folder the server.
The different treatments which use this mechanism must use all the services provided by FileUploadManager
and UploadedFile
in order to save definitely the uploaded files.
Method Summary | |
---|---|
void |
clear()
Clears the session (deletes all the file from the server). |
static void |
clearFrom(SessionInfo sessionInfo)
Clears the upload sessions still attached to a user session. |
UploadSession |
forComponentInstanceId(String componentInstanceId)
Sets the component instance id associated to the upload session. |
static UploadSession |
from(javax.servlet.http.HttpServletRequest request)
Initializes an instance from a request (if not created, a new one will be created if necessary). |
static UploadSession |
from(String uploadSessionId)
Initializes an instance from a session id (if not created, a new one will be created if necessary). |
String |
getComponentInstanceId()
Gets the component instance id if any associated. |
String |
getComponentInstanceParameterValue(String parameterName)
Gets the parameter value of a component instance. |
String |
getId()
Gets the session identifier. |
File |
getRootFolder()
Gets the root folder on the server of the upload session. |
File[] |
getRootFolderFiles()
Gets the File list (so file or folder) from the root folder on the server of the
upload
session. |
UploadSessionFile |
getUploadSessionFile(String fullPath)
Gets a new upload file from the session. |
boolean |
isUserAuthorized(String componentInstanceId)
Indicates if the current user is authorized to perform this upload session. |
boolean |
remove(String fullPath)
Removes from the upload session the file identified by the given identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public UploadSession forComponentInstanceId(String componentInstanceId)
componentInstanceId
- public boolean isUserAuthorized(String componentInstanceId)
componentInstanceId
- public String getId()
public String getComponentInstanceId()
public String getComponentInstanceParameterValue(String parameterName)
public void clear()
public boolean remove(String fullPath) throws Exception
fullPath
- the path of the file into the session.
Exception
public UploadSessionFile getUploadSessionFile(String fullPath) throws Exception
UploadSessionFile.getServerFile()
of the returned instance is null.
fullPath
- the path of the file into the session.
Exception
public File getRootFolder()
File
that represents the upload session folder.public File[] getRootFolderFiles()
File
list (so file or folder) from the root folder on the server of the
upload
session.
File
from the root folder provided by getRootFolder()
.public static UploadSession from(javax.servlet.http.HttpServletRequest request)
request
- an http servlet request.
public static UploadSession from(String uploadSessionId)
uploadSessionId
- an existing, or not, upload session id.
public static void clearFrom(SessionInfo sessionInfo)
sessionInfo
- the session of a user.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |