public void setPaths()

in core/src/main/java/flex/messaging/config/SystemSettings.java [131:200]


    public void setPaths(ServletContext context) {
        if (redeployEnabled) {
            List resolvedWatches = new ArrayList();
            for (int i = 0; i < watches.size(); i++) {
                String path = (String) watches.get(i);
                String resolvedPath = null;
                if (path.startsWith("{context.root}") || path.startsWith("{context-root}")) {
                    path = path.substring(14);
                    resolvedPath = context.getRealPath(path);

                    if (resolvedPath != null) {
                        try {
                            resolvedWatches.add(new WatchedObject(resolvedPath));
                        } catch (FileNotFoundException fnfe) {
                            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                            if (logger != null) {
                                logger.warn("The watch-file, " + path + ", could not be found and will be ignored.");
                            }
                        }
                    } else {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        logger.warn("The watch-file, " + path + ", could not be resolved to a path and will be ignored.");
                    }
                } else {
                    try {
                        resolvedWatches.add(new WatchedObject(path));
                    } catch (FileNotFoundException fnfe) {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        if (logger != null) {
                            logger.warn("The watch-file, " + path + ", could not be found and will be ignored.");
                        }
                    }
                }
            }
            watches = resolvedWatches;

            List resolvedTouches = new ArrayList();
            for (int i = 0; i < touches.size(); i++) {
                String path = (String) touches.get(i);
                String resolvedPath = null;
                if (path.startsWith("{context.root}") || path.startsWith("{context-root}")) {
                    path = path.substring(14);
                    resolvedPath = context.getRealPath(path);

                    if (resolvedPath != null) {
                        File file = new File(resolvedPath);
                        if (!file.exists() || (!file.isFile() && !file.isDirectory()) || (!file.isAbsolute())) {
                            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                            logger.warn("The touch-file, " + path + ", could not be found and will be ignored.");
                        } else {
                            resolvedTouches.add(resolvedPath);
                        }
                    } else {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        logger.warn("The touch-file, " + path + ", could not be resolved to a path and will be ignored.");
                    }
                } else {
                    try {
                        resolvedTouches.add(new WatchedObject(path));
                    } catch (FileNotFoundException fnfe) {
                        Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
                        if (logger != null) {
                            logger.warn("The touch-file, " + path + ", could not be found and will be ignored.");
                        }
                    }
                }
            }
            touches = resolvedTouches;
        }
    }