View Javadoc

1   /*
2    * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3    * Copyright (C) 2004-2010 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  /**
26   * An interface for userfiles path construction. In particular, this interface
27   * gives you the ability to construct the {@code connector.userFilesPath} and
28   * {@code connector.userFilesAbsolutePath} properties dynamically. See <a
29   * href="http://java.fckeditor.net/properties.html">configuration</a> for more
30   * details.
31   * <p>
32   * <strong>Note:</strong> You are free to implement this interface the way you
33   * need it, in other words your return values can be global, regardless of the
34   * request, or on a per-request basis.
35   * </p>
36   * 
37   * @version $Id: UserPathBuilder.java 4785 2009-12-21 20:10:28Z mosipov $
38   */
39  public interface UserPathBuilder {
40  
41  	/**
42  	 * Returns the constructed server-side userfiles absolute path. This method
43  	 * is the dynamic constructor of the {@code connector.userFilesAbsolutePath}
44  	 * property. A concrete connector implementation will use this value to
45  	 * resolve the server-side location of resources.
46  	 * 
47  	 * @param request
48  	 *            current user request instance
49  	 * @return the constructed server-side userfiles absolute path
50  	 */
51  	public String getUserFilesAbsolutePath(final HttpServletRequest request);
52  
53  	/**
54  	 * Returns the constructed client-side userfiles path. This method is the
55  	 * dynamic constructor of the {@code connector.userFilesPath} property. A
56  	 * browser will use this value to resolve the url-side location of resources
57  	 * on the server.
58  	 * 
59  	 * @param request
60  	 *            current user request instance
61  	 * @return the constructed client-side userfiles path
62  	 */
63  	public String getUserFilesPath(final HttpServletRequest request);
64  }