Show
Ignore:
Timestamp:
2008-02-13 23:08:27 (9 months ago)
Author:
mosipov
Message:

rewrite of FileType to ResourceType and more

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/handlers/ConfigurationHandler.java

    r1492 r1509  
    4848 * Something special is {@link ISessionData}. The implemented class provides some session based data. 
    4949 * See {@link ISessionData} for additional informations. For example, to get a user based base dir, 
    50  * for each request {@link #getBaseDir(HttpServletRequest)} is calling. If 'sessionData' is set, 
     50 * for each request {@link #getUserFilesPath(HttpServletRequest)} is calling. If 'sessionData' is set, 
    5151 * {@link ISessionData#getBaseDir(HttpServletRequest)} will be returned, otherwise the default base 
    5252 * dir. 
     
    5858 
    5959        private static Properties defaultProperties = new Properties(); 
    60         private static String baseDir; 
     60        private static String userFilesPath; 
    6161        private static ISessionData sessionData = null; 
    62         private static String fckEditorDir; 
     62        private static String basePath; 
    6363        private static String fckEditorHeight; 
    6464        private static String fckEditorWidth; 
     
    8282                        throw new RuntimeException("Can't load default properties!", e); 
    8383                } 
    84                 baseDir = defaultProperties.getProperty("fckeditor.basedir"); 
    85                 fckEditorDir = defaultProperties.getProperty("fckeditor.dir"); 
     84                userFilesPath = defaultProperties.getProperty("connector.userFilesPath"); 
     85                basePath = defaultProperties.getProperty("fckeditor.basePath"); 
    8686                fckEditorWidth = defaultProperties.getProperty("fckeditor.width"); 
    8787                fckEditorHeight = defaultProperties.getProperty("fckeditor.height"); 
    88                 fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbarset"); 
     88                fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbarSet"); 
    8989                forceSingleExtension = Boolean.valueOf(defaultProperties 
    90                         .getProperty("fckeditor.forcesingleextension")); 
     90                        .getProperty("connector.forceSingleExtension")); 
    9191 
    9292                logger.info("Default properties loaded and initialized successfully."); 
     
    9999         *         {@link ISessionData}} isn't set. 
    100100         */ 
    101         public static String getBaseDir(final HttpServletRequest servletRequest) { 
     101        public static String getUserFilesPath(final HttpServletRequest servletRequest) { 
    102102                if (sessionData == null || sessionData.getBaseDir(servletRequest) == null) 
    103                         return getDefaultBaseDir(); 
     103                        return getDefaultUserFilesPath(); 
    104104                return sessionData.getBaseDir(servletRequest); 
    105105        } 
    106106 
    107107        /** 
    108          * Getter for the default baseDir. 
     108         * Getter for the default userFilesPath. 
    109109         *  
    110110         * @return 
    111111         */ 
    112         public static String getDefaultBaseDir() { 
    113                 return baseDir; 
    114         } 
    115  
    116         /** 
    117          * Setter for the base dir (using for user files). If param 'baseDir' is empty, the property 
     112        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 
    118118         * leaves untouched. 
    119119         *  
    120          * @param baseDir 
     120         * @param userFilesPath 
    121121         *            relative to the context root (no leading or ending /). 
    122122         */ 
    123         public static void setBaseDir(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; 
    126126        } 
    127127 
     
    154154         * @return Dir of the fckeditor relative to the context root. 
    155155         */ 
    156         public static String getFckEditorDir() { 
    157                 return fckEditorDir; 
     156        public static String getBasePath() { 
     157                return basePath; 
    158158        } 
    159159 
     
    161161         * Setter for the dir of the fckeditor. 
    162162         *  
    163          * @param fckEditorDir 
     163         * @param basePath 
    164164         *            relative to the context root (no leading or ending /). 
    165165         */ 
    166166        public static void setFckEditorDir(final String fckEditorDir) { 
    167                 ConfigurationHandler.fckEditorDir = fckEditorDir; 
     167                ConfigurationHandler.basePath = fckEditorDir; 
    168168        } 
    169169