View Javadoc

1   /*
2    * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3    * Copyright (C) 2003-2008 Frederico Caldeira Knabben
4    * 
5    * == BEGIN LICENSE ==
6    * 
7    * Licensed under the terms of any of the following licenses at your
8    * choice:
9    * 
10   *  - GNU General Public License Version 2 or later (the "GPL")
11   *    http://www.gnu.org/licenses/gpl.html
12   * 
13   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14   *    http://www.gnu.org/licenses/lgpl.html
15   * 
16   *  - Mozilla Public License Version 1.1 or later (the "MPL")
17   *    http://www.mozilla.org/MPL/MPL-1.1.html
18   * 
19   * == END LICENSE ==
20   */
21  package net.fckeditor.requestcycle;
22  
23  import javax.servlet.http.HttpServletRequest;
24  
25  import net.fckeditor.handlers.ConnectorHandler;
26  
27  /**
28   * An interface which provides a way to build a user-dependent
29   * <code>UserFilesPath</code>.
30   * 
31   * @version $Id: UserPathBuilder.java 2151 2008-07-02 22:03:15Z mosipov $
32   */
33  public interface UserPathBuilder {
34  
35  	/**
36  	 * Getter for the user-dependent <code>UserFilesPath</code>.<br />
37  	 * <strong>Important:</strong>
38  	 * <ul>
39  	 * <li> If the implementation returns <code>null</code>,
40  	 * {@link ConnectorHandler} will used the default one! That's useful, if the
41  	 * implementation doesn't bother you.</li>
42  	 * <li>The returned directory string has to start with '/', but has to end
43  	 * without '/'.</li>
44  	 * <li>The path has to be within the context.</li>
45  	 * </ul>
46  	 * 
47  	 * @param request
48  	 * @return <code>null</code> or the <code>UserFilesPath</code> for the
49  	 *         current user.
50  	 */
51  	public String getUserFilesPath(final HttpServletRequest request);
52  }