Package eu.planets_project.ifr.core.common.conf

Examples of eu.planets_project.ifr.core.common.conf.Configuration


        // Clean up the test temp area
        DigitalObjectManagerTests.deleteDirectory(new File(AllStorageSuite.TEST_TEMP_BASE));

        // Instantiate a file based data registry instance
    // Point it at a root directory in resources, the registry will create the dir if necessary
        Configuration config = ServiceConfig.getConfiguration(new File(CONFIG + TEMP_PROPS));
        DigitalObjectManagerTests.dom = new TempFilesystemDigitalObjectManagerImpl(config);
  }
View Full Code Here


   * @throws MalformedURLException
   */
  @Test(expected=IllegalArgumentException.class)
  public final void testMissingPath() throws URISyntaxException, MalformedURLException {
    // Not doing too much here, just setting up a bad instance and catching the exception
        Configuration config = ServiceConfig.getConfiguration(new File(CONFIG + MISSING_PATH_PROPS));
    new FilesystemDigitalObjectManagerImpl(config);
  }
View Full Code Here

   * @throws MalformedURLException
   */
  @Test(expected=IllegalArgumentException.class)
  public final void testMissingName() throws URISyntaxException, MalformedURLException {
    // Not doing too much here, just setting up a bad instance and catching the exception
        Configuration config = ServiceConfig.getConfiguration(new File(CONFIG + MISSING_NAME_PROPS));
    new FilesystemDigitalObjectManagerImpl(config);
  }
View Full Code Here

   * @throws MalformedURLException
   */
  @Test(expected=IllegalArgumentException.class)
  public final void testBadName() throws URISyntaxException, MalformedURLException {
    // Not doing too much here, just setting up a bad instance and catching the exception
        Configuration config = ServiceConfig.getConfiguration(new File(CONFIG + BAD_NAME_PROPS));
    new FilesystemDigitalObjectManagerImpl(config);
  }
View Full Code Here

    public static String getSigFileLocation() {
      // String to hold the location
        String sigFileLocation = null;
        // Get the configuration object from the ServiceConfig util
        try {
        Configuration conf = ServiceConfig.getConfiguration(COMMON_CONF_FILE_NAME);
        // Create the file name from the properties
        sigFileLocation = conf.getString(SIG_FILE_LOC_KEY) +
            File.separator + conf.getString(SIG_FILE_NAME_KEY);
        } catch( ConfigurationException e ) {
          log.severe("Could not find configuration file! "+e);
        }
        log.info("DROID Signature File location:" + sigFileLocation);
        // Check if the sigFileLocation is sane, and override with internal resource if not:
View Full Code Here

     * @throws Exception
     */
    @Before
    public void setUp() throws Exception {

  final Configuration environmentConfiguration = ServiceConfig
    .getConfiguration("genericwrapper2_GenericMigrationWrapperTest");

  final DocumentLocator documentLocator = new DocumentLocator(
    "GenericWrapperConfigFileExample.xml");

View Full Code Here

    };

    // Iterate through contained files
    for (File propFile : propDir.listFiles(sel)) {
      // Get the properties set from the file
      Configuration config = ServiceConfig.getConfiguration(propFile);
       
      // Add the registry to the hash map, the Interface class is instantiated
      // from the class name
      DigitalObjectManagerBase dom = getDomBaseInstance(config);
      if (dom != null) {
        log.info("Adding DOM: " + config.getString(DigitalObjectManagerBase.NAME_KEY));
        DataRegistryImpl.domSet.put(dom.getId(), dom);
        // Now check if the default property set true and
        // we haven't got a default yet (this.defaultDomUri not null)
        // First default wins
        String isDefault = "";
        try {
          isDefault = config.getString(DataRegistry.DEFAULT_KEY);
        // No default key but not a problem
        } catch (NoSuchElementException e) {
          isDefault = "";
        }
        if (isDefault.equals("true") &&
View Full Code Here

   * @return The String name of the DataRegistry default config dir
   */
    private static boolean setUpDefaultFolders() {

      boolean defaultsOK = false;
      Configuration conf = ServiceConfig.getConfiguration("DataRegistry");

      try {
        DataRegistryImpl.defaultDomDirName = conf.getString(DataRegistryImpl.DEFAULT_CONFIG_KEY);

        // If it's a directory we're OK
        if (new File(DataRegistryImpl.defaultDomDirName).isDirectory())
          defaultsOK = true;
           // If it's not a directory, once again not terminal, but erase the name
        else
          DataRegistryImpl.defaultDomDirName = null;
      } catch (NoSuchElementException e) {
        // No default directory found, unusual, so should log as severe but not a show stopper
        DataRegistryImpl.log.severe("Config file for DataRegistry didn't contain a " + DataRegistryImpl.DEFAULT_CONFIG_KEY + " property.");
      }

      try {
        DataRegistryImpl.userDomDirName = conf.getString(DataRegistryImpl.USER_CONFIG_KEY);

        // If it's a directory we're OK
        if (new File(DataRegistryImpl.userDomDirName).isDirectory())
          defaultsOK = true;
           // If it's not a directory, once again not terminal, but erase the name
View Full Code Here

    }

    private static String sigFileFolder() {
      log.info("Droid.sigFileFolder()");
        String sigFileLocation = null;
      Configuration conf = ServiceConfig.getConfiguration("Droid");
      sigFileLocation = conf.getString("droid.sigfile.location") +
        File.separator + conf.getString("droid.sigfile.name");
      log.info("Opening signature file: " + sigFileLocation);
      return sigFileLocation;
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.common.conf.Configuration

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.