List of usage examples for org.apache.commons.configuration ConfigurationException printStackTrace
public void printStackTrace()
From source file:org.parosproxy.paros.extension.scanner.ExtensionScanner.java
/** * This method initializes menuItemPolicy * //from www. ja v a 2 s. co m * @return javax.swing.JMenuItem */ private JMenuItem getMenuItemPolicy() { if (menuItemPolicy == null) { menuItemPolicy = new JMenuItem(); menuItemPolicy.setText("Scan Policy..."); menuItemPolicy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { PolicyDialog dialog = new PolicyDialog(getView().getMainFrame()); dialog.initParam(getModel().getOptionsParam()); int result = dialog.showDialog(false); if (result == JOptionPane.OK_OPTION) { try { getModel().getOptionsParam().getConfig().save(); } catch (ConfigurationException ce) { ce.printStackTrace(); getView().showWarningDialog("Error saving policy."); return; } } } }); } return menuItemPolicy; }
From source file:org.parosproxy.paros.view.AbstractFrame.java
private void storeLocation() { if (frameName == null) { return;// w ww. j av a 2s . c o m } FileConfiguration config = loadConfig(); String configName = "ui." + frameName; Point location = getLocation(); config.setAutoSave(true); config.setProperty(configName + PROP_LEFT, Integer.toString(location.x)); config.setProperty(configName + PROP_TOP, Integer.toString(location.y)); config.setProperty(configName + PROP_WIDTH, Integer.toString(getWidth())); config.setProperty(configName + PROP_HEIGHT, Integer.toString(getHeight())); try { config.save(); } catch (ConfigurationException e) { e.printStackTrace(); } System.out.println("STORE " + frameName + " " + location.x + " " + location.y + " " + getWidth() + " " + getHeight()); }
From source file:org.parosproxy.paros.view.AbstractFrame.java
private FileConfiguration loadConfig() { FileConfiguration config = Model.createConfig(); try {//from ww w. j a va 2 s .c o m config.load(); } catch (ConfigurationException e) { e.printStackTrace(); } return config; }
From source file:org.programmatori.domotica.own.emulator.ConfigBus.java
public void loadConfig(String fileName) { try {//from www. ja v a 2 s .c om XMLConfiguration config = new XMLConfiguration(fileName); String version = config.getString("version"); if (version.equals("1.0")) { loadConfig10(config); } else if (version.equals("2.0")) { loadConfig20(config); } else { log.warn("Unknown version of the configuration bus: " + version); } } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:org.programmatori.domotica.own.sdk.config.AbstractConfig.java
private void loadConfig() { try {//from ww w . j av a2 s . co m config = new XMLConfiguration(getConfigPath() + "/config.xml"); config.setAutoSave(true); log.info("Config File: " + config.getURL()); configLoaded = true; } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:org.restcomm.connect.dao.mybatis.NotificationsDaoTest.java
@Before public void before() { final InputStream data = getClass().getResourceAsStream("/mybatis.xml"); final SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder(); final SqlSessionFactory factory = builder.build(data); manager = new MybatisDaoManager(); manager.start(factory);//from ww w . j a va 2 s. c om XMLConfiguration xmlConfiguration = new XMLConfiguration(); xmlConfiguration.setDelimiterParsingDisabled(true); xmlConfiguration.setAttributeSplittingDisabled(true); try { xmlConfiguration.load("restcomm.xml"); RestcommConfiguration.createOnce(xmlConfiguration); RestcommConfiguration.getInstance().getMain().setInstanceId(instanceId.toString()); } catch (ConfigurationException e) { e.printStackTrace(); } }
From source file:org.restcomm.connect.http.cors.CorsFilter.java
private void initLazily(ServletRequest request) { if (lazyServletContext == null) { ServletContext context = request.getServletContext(); String rootPath = context.getRealPath("/"); rootPath = StringUtils.stripEnd(rootPath, "/"); // remove trailing "/" character String restcommXmlPath = rootPath + "/WEB-INF/conf/restcomm.xml"; // ok, found restcomm.xml. Now let's get rcmlserver/base-url configuration setting File restcommXmlFile = new File(restcommXmlPath); // Create apache configuration XMLConfiguration apacheConf = new XMLConfiguration(); apacheConf.setDelimiterParsingDisabled(true); apacheConf.setAttributeSplittingDisabled(true); try {//from w w w. j a v a2 s. c o m apacheConf.load(restcommXmlPath); } catch (ConfigurationException e) { e.printStackTrace(); } // Create high-level configuration ConfigurationSource source = new ApacheConfigurationSource(apacheConf); RcmlserverConfigurationSet rcmlserverConfig = new RcmlserverConfigurationSetImpl(source); // initialize allowedOrigin String baseUrl = rcmlserverConfig.getBaseUrl(); if (baseUrl != null && (!baseUrl.trim().equals(""))) { // baseUrl is set. We need to return CORS allow headers allowedOrigin = baseUrl; } lazyServletContext = context; logger.info("Initialized (lazily) CORS servlet response filter. allowedOrigin: " + allowedOrigin); } }
From source file:org.securitytests.cisecurity.Config.java
public void loadConfig(String file) { try {/*w ww .j a v a2 s .co m*/ xml = new XMLConfiguration(); xml.load(file); } catch (ConfigurationException cex) { cex.printStackTrace(); System.exit(1); } }
From source file:org.ssh.test.conf.IConfiguration.java
/** * <pre>//www . ja va 2s.c om * Description: * ??? * </pre> * * @author shanke * @date 20151129 ?12:29:51 * @return */ public static IConfiguration getInstance() { if (conf == null) { synchronized (IConfiguration.class) { IConfigurationBuilder builder = null; if (conf == null) { try { builder = new IConfigurationBuilder("config.xml"); conf = builder.getConfiguration(true); logger.error("???"); } catch (ConfigurationException e) { e.printStackTrace(); logger.error("??", e); } } } } return conf; }
From source file:org.tools.i18n.Property.java
/** * Saves to the specified location. Uses the store method of Properties, * therefore fully compatible with ".properties" files. * * Does not save any parent. A description can be set but it's useless since * it is not read upon load. Just use a key with the description as content * if you need one.// ww w .j a va 2 s . c o m * * @return True if the location was set and an OutputStream could be * obtained and the storing of the Property was okay. */ public boolean save() { if (location == null) { return false; } try { prop.save(location.getOutputStream()); } catch (ConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; }