Changeset 1509 for FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/handlers/ConfigurationHandler.java
- Timestamp:
- 2008-02-13 23:08:27 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/handlers/ConfigurationHandler.java
r1492 r1509 48 48 * Something special is {@link ISessionData}. The implemented class provides some session based data. 49 49 * See {@link ISessionData} for additional informations. For example, to get a user based base dir, 50 * for each request {@link #get BaseDir(HttpServletRequest)} is calling. If 'sessionData' is set,50 * for each request {@link #getUserFilesPath(HttpServletRequest)} is calling. If 'sessionData' is set, 51 51 * {@link ISessionData#getBaseDir(HttpServletRequest)} will be returned, otherwise the default base 52 52 * dir. … … 58 58 59 59 private static Properties defaultProperties = new Properties(); 60 private static String baseDir;60 private static String userFilesPath; 61 61 private static ISessionData sessionData = null; 62 private static String fckEditorDir;62 private static String basePath; 63 63 private static String fckEditorHeight; 64 64 private static String fckEditorWidth; … … 82 82 throw new RuntimeException("Can't load default properties!", e); 83 83 } 84 baseDir = defaultProperties.getProperty("fckeditor.basedir");85 fckEditorDir = defaultProperties.getProperty("fckeditor.dir");84 userFilesPath = defaultProperties.getProperty("connector.userFilesPath"); 85 basePath = defaultProperties.getProperty("fckeditor.basePath"); 86 86 fckEditorWidth = defaultProperties.getProperty("fckeditor.width"); 87 87 fckEditorHeight = defaultProperties.getProperty("fckeditor.height"); 88 fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbar set");88 fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbarSet"); 89 89 forceSingleExtension = Boolean.valueOf(defaultProperties 90 .getProperty(" fckeditor.forcesingleextension"));90 .getProperty("connector.forceSingleExtension")); 91 91 92 92 logger.info("Default properties loaded and initialized successfully."); … … 99 99 * {@link ISessionData}} isn't set. 100 100 */ 101 public static String get BaseDir(final HttpServletRequest servletRequest) {101 public static String getUserFilesPath(final HttpServletRequest servletRequest) { 102 102 if (sessionData == null || sessionData.getBaseDir(servletRequest) == null) 103 return getDefault BaseDir();103 return getDefaultUserFilesPath(); 104 104 return sessionData.getBaseDir(servletRequest); 105 105 } 106 106 107 107 /** 108 * Getter for the default baseDir.108 * Getter for the default userFilesPath. 109 109 * 110 110 * @return 111 111 */ 112 public static String getDefault BaseDir() {113 return baseDir;114 } 115 116 /** 117 * Setter for the base dir (using for user files). If param ' baseDir' is empty, the property112 public static String getDefaultUserFilesPath() { 113 return userFilesPath; 114 } 115 116 /** 117 * Setter for the base dir (using for user files). If param 'userFilesPath' is empty, the property 118 118 * leaves untouched. 119 119 * 120 * @param baseDir120 * @param userFilesPath 121 121 * relative to the context root (no leading or ending /). 122 122 */ 123 public static void set BaseDir(final String baseDir) {124 if (Utils.isNotEmpty( baseDir))125 ConfigurationHandler. baseDir = baseDir;123 public static void setUserFilesPath(final String userFilesPath) { 124 if (Utils.isNotEmpty(userFilesPath)) 125 ConfigurationHandler.userFilesPath = userFilesPath; 126 126 } 127 127 … … 154 154 * @return Dir of the fckeditor relative to the context root. 155 155 */ 156 public static String get FckEditorDir() {157 return fckEditorDir;156 public static String getBasePath() { 157 return basePath; 158 158 } 159 159 … … 161 161 * Setter for the dir of the fckeditor. 162 162 * 163 * @param fckEditorDir163 * @param basePath 164 164 * relative to the context root (no leading or ending /). 165 165 */ 166 166 public static void setFckEditorDir(final String fckEditorDir) { 167 ConfigurationHandler. fckEditorDir= fckEditorDir;167 ConfigurationHandler.basePath = fckEditorDir; 168 168 } 169 169