railo.runtime.config
Class ConfigWebUtil

java.lang.Object
  extended by railo.runtime.config.ConfigWebUtil

public final class ConfigWebUtil
extends Object


Constructor Summary
ConfigWebUtil()
           
 
Method Summary
static void checkGeneralReadAccess(ConfigImpl config, String password)
           
static void checkGeneralWriteAccess(ConfigImpl config, String password)
           
static void checkPassword(ConfigImpl config, String type, String password)
           
static String createMD5FromResource(Resource resource)
           
static Resource getExistingResource(javax.servlet.ServletContext sc, String strDir, String defaultDir, Resource configDir, short type, ConfigImpl config)
          get only a existing file, dont create it
static Resource getFile(Config config, Resource directory, String path, short type)
          touch a file object by the string definition
static Resource getFile(Resource file, short type)
           
static Object getIdMapping(Mapping m)
           
static LogAndSource getLogAndSource(ConfigServer configServer, Config config, String strLogger, boolean hasAccess, int logLevel)
          loads log
static boolean hasAccess(Config config, int type)
          has access checks if config object has access to given type
static String inspectTemplate(short s, String defaultValue)
           
static short inspectTemplate(String str, short defaultValue)
           
static boolean isDirectory(Resource directory)
          checks if file is a directory or not, if directory doesn't exist, it will be created
static boolean isFile(Resource file)
          checks if file is a file or not, if file doesn't exist, it will be created
static ApplicationListener loadListener(String type, ApplicationListener defaultValue)
           
static String replacePlaceholder(String str, Config config)
           
static int toListenerMode(String strListenerMode, int defaultValue)
           
static String translateOldPath(String path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigWebUtil

public ConfigWebUtil()
Method Detail

getFile

public static Resource getFile(Config config,
                               Resource directory,
                               String path,
                               short type)
touch a file object by the string definition

Parameters:
config -
directory -
path -
type -
Returns:
matching file

replacePlaceholder

public static String replacePlaceholder(String str,
                                        Config config)

getExistingResource

public static Resource getExistingResource(javax.servlet.ServletContext sc,
                                           String strDir,
                                           String defaultDir,
                                           Resource configDir,
                                           short type,
                                           ConfigImpl config)
get only a existing file, dont create it

Parameters:
sc -
strDir -
defaultDir -
configDir -
type -
config -
Returns:
existing file

getFile

public static Resource getFile(Resource file,
                               short type)
Parameters:
file -
type - (FileUtil.TYPE_X)
Returns:
created file

isDirectory

public static boolean isDirectory(Resource directory)
checks if file is a directory or not, if directory doesn't exist, it will be created

Parameters:
directory -
Returns:
is directory or not

isFile

public static boolean isFile(Resource file)
checks if file is a file or not, if file doesn't exist, it will be created

Parameters:
file -
Returns:
is file or not

hasAccess

public static boolean hasAccess(Config config,
                                int type)
has access checks if config object has access to given type

Parameters:
config -
type -
Returns:
has access

getLogAndSource

public static LogAndSource getLogAndSource(ConfigServer configServer,
                                           Config config,
                                           String strLogger,
                                           boolean hasAccess,
                                           int logLevel)
                                    throws IOException
loads log

Parameters:
configServer -
config -
strLogger -
hasAccess -
logLevel -
Returns:
log
Throws:
IOException

translateOldPath

public static String translateOldPath(String path)

getIdMapping

public static Object getIdMapping(Mapping m)

checkGeneralReadAccess

public static void checkGeneralReadAccess(ConfigImpl config,
                                          String password)
                                   throws SecurityException
Throws:
SecurityException

checkGeneralWriteAccess

public static void checkGeneralWriteAccess(ConfigImpl config,
                                           String password)
                                    throws SecurityException
Throws:
SecurityException

checkPassword

public static void checkPassword(ConfigImpl config,
                                 String type,
                                 String password)
                          throws SecurityException
Throws:
SecurityException

createMD5FromResource

public static String createMD5FromResource(Resource resource)
                                    throws IOException
Throws:
IOException

toListenerMode

public static int toListenerMode(String strListenerMode,
                                 int defaultValue)

loadListener

public static ApplicationListener loadListener(String type,
                                               ApplicationListener defaultValue)

inspectTemplate

public static short inspectTemplate(String str,
                                    short defaultValue)

inspectTemplate

public static String inspectTemplate(short s,
                                     String defaultValue)


Copyright © 2012 Railo