List of usage examples for org.jfree.chart.block LabelBlockImpl LabelBlockImpl
public LabelBlockImpl(String label)
From source file:lucee.runtime.config.ConfigWebFactory.java
/** * creates a new ServletConfig Impl Object * // w w w . ja va2 s. c om * @param configServer * @param configDir * @param servletConfig * @return new Instance * @throws SAXException * @throws ClassNotFoundException * @throws PageException * @throws IOException * @throws TagLibException * @throws FunctionLibException * @throws NoSuchAlgorithmException */ public static ConfigWebImpl newInstance(CFMLFactoryImpl factory, ConfigServerImpl configServer, Resource configDir, boolean isConfigDirACustomSetting, ServletConfig servletConfig) throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, NoSuchAlgorithmException { // DO NOT REMOVE!!!! try { new LabelBlockImpl("aa"); } catch (Throwable t) { } String hash = SystemUtil.hash(servletConfig.getServletContext()); Map<String, String> labels = configServer.getLabels(); String label = null; if (labels != null) { label = labels.get(hash); } if (label == null) label = hash; SystemOut.print(SystemUtil.getPrintWriter(SystemUtil.OUT), "===================================================================\n" + "WEB CONTEXT (" + label + ")\n" + "-------------------------------------------------------------------\n" + "- config:" + configDir + (isConfigDirACustomSetting ? " (custom setting)" : "") + "\n" + "- webroot:" + ReqRspUtil.getRootPath(servletConfig.getServletContext()) + "\n" + "- hash:" + hash + "\n" + "- label:" + label + "\n" + "===================================================================\n" ); boolean doNew = doNew(configDir); Resource configFile = configDir.getRealResource("lucee-web.xml.cfm"); Resource configFileOld = configDir.getRealResource("lucee-web.xml"); String strPath = servletConfig.getServletContext().getRealPath("/WEB-INF"); Resource path = ResourcesImpl.getFileResourceProvider().getResource(strPath); // get config file if (!configFile.exists()) { if (configFileOld.exists()) { // if(!configFileOld.renameTo(configFile)) configFile = configFileOld; } else createConfigFile("web", configFile); } Document doc = null; Resource bugFile; int count = 1; // rename old bugfiles while ((bugFile = configDir.getRealResource("lucee-web." + (count++) + ".buggy.cfm")).exists()) { bugFile.renameTo(configDir.getRealResource("lucee-web." + (count) + ".buggy")); } try { doc = loadDocument(configFile); } catch (Exception e) { // rename buggy config files if (configFile.exists()) { SystemOut.printDate(SystemUtil.getPrintWriter(SystemUtil.OUT), "config file " + configFile + " was not valid and has been replaced"); count = 1; while ((bugFile = configDir.getRealResource("lucee-web." + (count++) + ".buggy")).exists()) { } IOUtil.copy(configFile, bugFile); configFile.delete(); } createConfigFile("web", configFile); doc = loadDocument(configFile); } // htaccess if (path.exists()) createHtAccess(path.getRealResource(".htaccess")); if (configDir.exists()) createHtAccess(configDir.getRealResource(".htaccess")); createContextFiles(configDir, servletConfig, doNew); ConfigWebImpl configWeb = new ConfigWebImpl(factory, configServer, servletConfig, configDir, configFile); load(configServer, configWeb, doc, false, doNew); createContextFilesPost(configDir, configWeb, servletConfig, false, doNew); return configWeb; }
From source file:lucee.runtime.config.XMLConfigWebFactory.java
/** * creates a new ServletConfig Impl Object * // w w w .j a v a 2 s. c o m * @param configServer * @param configDir * @param servletConfig * @return new Instance * @throws SAXException * @throws ClassNotFoundException * @throws PageException * @throws IOException * @throws TagLibException * @throws FunctionLibException * @throws NoSuchAlgorithmException * @throws BundleException */ public static ConfigWebImpl newInstance(CFMLFactoryImpl factory, ConfigServerImpl configServer, Resource configDir, boolean isConfigDirACustomSetting, ServletConfig servletConfig) throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, NoSuchAlgorithmException, BundleException { // DO NOT REMOVE!!!! try { new LabelBlockImpl("aa"); } catch (Throwable t) { } String hash = SystemUtil.hash(servletConfig.getServletContext()); Map<String, String> labels = configServer.getLabels(); String label = null; if (labels != null) { label = labels.get(hash); } if (label == null) label = hash; SystemOut.print(SystemUtil.getPrintWriter(SystemUtil.OUT), "===================================================================\n" + "WEB CONTEXT (" + label + ")\n" + "-------------------------------------------------------------------\n" + "- config:" + configDir + (isConfigDirACustomSetting ? " (custom setting)" : "") + "\n" + "- webroot:" + ReqRspUtil.getRootPath(servletConfig.getServletContext()) + "\n" + "- hash:" + hash + "\n" + "- label:" + label + "\n" + "===================================================================\n" ); boolean doNew = doNew(configDir); Resource configFile = configDir.getRealResource("lucee-web.xml." + TEMPLATE_EXTENSION); String strPath = servletConfig.getServletContext().getRealPath("/WEB-INF"); Resource path = ResourcesImpl.getFileResourceProvider().getResource(strPath); // get config file if (!configFile.exists()) { createConfigFile("web", configFile); } Document doc = null; Resource bugFile; int count = 1; doc = loadDocumentCreateIfFails(configFile, "web"); // htaccess if (path.exists()) createHtAccess(path.getRealResource(".htaccess")); if (configDir.exists()) createHtAccess(configDir.getRealResource(".htaccess")); createContextFiles(configDir, servletConfig, doNew); ConfigWebImpl configWeb = new ConfigWebImpl(factory, configServer, servletConfig, configDir, configFile); load(configServer, configWeb, doc, false, doNew); createContextFilesPost(configDir, configWeb, servletConfig, false, doNew); return configWeb; }