org.silverpeas.attachment.web
Class WebDavTokenProducer

java.lang.Object
  extended by org.silverpeas.attachment.web.WebDavTokenProducer

public class WebDavTokenProducer
extends Object

A producer of a token to access by WebDAV a document.

Author:
miguel

Constructor Summary
WebDavTokenProducer()
           
 
Method Summary
static void deleteToken(UserDetail user, String documentId)
          Deletes the token that was generated for the specified user to access the specified document.
static String generateToken(UserDetail user, String documentId)
          Generates a token for the specified user to edit by WebDAV the specified document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDavTokenProducer

public WebDavTokenProducer()
Method Detail

generateToken

public static String generateToken(UserDetail 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(UserDetail 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.


Copyright © 2016 Silverpeas. All Rights Reserved.