Class WebDavTokenProducer
- java.lang.Object
-
- org.silverpeas.core.web.attachment.WebDavTokenProducer
-
public class WebDavTokenProducer extends Object
A producer of a token to access by WebDAV a document.- Author:
- miguel
-
-
Constructor Summary
Constructors Constructor Description WebDavTokenProducer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteToken(User user, String documentId)
Deletes the token that was generated for the specified user to access the specified document.static String
generateToken(User user, String documentId)
Generates a token for the specified user to edit by WebDAV the specified document.
-
-
-
Method Detail
-
generateToken
public static String generateToken(User user, String documentId)
Generates a token for the specified user to edit by WebDAV the specified document. The token is like a key to edit a given document.- Parameters:
user
- the user for which a token is generated.documentId
- the unique identifier of the document to access by WebDAV.- Returns:
- the generated token.
-
deleteToken
public static void deleteToken(User user, String documentId) throws IllegalArgumentException
Deletes the token that was generated for the specified user to access the specified document. If no such tokens exist, then nothing is done. If the token doesn't belong to the user, then an IllegalArgumentException is thrown.- Parameters:
documentId
- the unique identifier of the document.- Throws:
IllegalArgumentException
- if the specified user has no token to access the specified document.
-
-