Package org.pdfsam.guiclient.exceptions

Examples of org.pdfsam.guiclient.exceptions.ConfigurationException


    try {
      configurationFile = getConfigurationXmlFile(CONFIGURATION_FILE_NAME);
      if(configurationFile == null){
        configurationFile = getConfigurationXmlFile(OLD_CONFIGURATION_FILE_NAME);
        if(configurationFile == null){
          throw new ConfigurationException("Unable to find configuration file");
        }
      }
      configurationFilePath = configurationFile.getAbsolutePath();
      Document document = XmlUtility.parseXmlFile(configurationFile);
      if (document != null) {
        // setting up strategy
        XmlConfigStrategy strategy = null;
        Node node = document.selectSingleNode(VERSION_XPATH);
        if (node != null && "2".equals(node.getText().trim())) {
          strategy = new DefaultXmlStrategy(document);
        } else {
          strategy = new BackwardCompatibilityXmlStrategy(document);
        }

        initializeLocale(strategy);
        initializeLookAndFeel(strategy);
        initializeLoggingLevel(strategy);
        initializePoolSize(strategy);

        defaultWorkingDirectory = strategy.getDefaultWorkingDirectoryValue();
        defaultEnvironment = strategy.getDefaultEnvironmentValue();
        thumbnailsCreatorIdentifier = strategy.getThumbnailsCreatorIdentifierValue();
        checkForUpdates = isValidTrueValue(strategy.getCheckForUpdatesValue());
        playSounds = isValidTrueValue(strategy.getPlaySoundsValue());
        pluginAbsolutePath = strategy.getPluginAbsolutePath();
        askOverwriteConfirmation = isValidTrueValue(strategy.getAskOverwriteConfirmation());

        consoleServicesFacade = new ConsoleServicesFacade();
        strategy.close();
      } else {
        throw new ConfigurationException("Unable to parse xml configuration file.");
      }
    } catch (DocumentException e) {
      throw new ConfigurationException(e);
    } catch (UnsupportedEncodingException ue) {
      throw new ConfigurationException(ue);
    }
  }
View Full Code Here


          if (defaultPath.mkdirs()) {
            log.info("Copying " + configurationFileName + " from " + secondaryPath.getPath() + " to "
                + defaultPath.getPath());
            FileUtility.copyFile(secondaryPath, retVal);
          } else {
            throw new ConfigurationException("Unable to create " + defaultPath);
          }
        } else {
          retVal = secondaryPath;
        }
      } else {
View Full Code Here

TOP

Related Classes of org.pdfsam.guiclient.exceptions.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.