Package com.cloudloop.config.exceptions

Examples of com.cloudloop.config.exceptions.InvalidConfigurationException


    File rootDir = _cloudStore.getRootDirectory( );
    for (String restrictionPattern : RESTRICTED_ROOT_DIRS)
    {
      if (rootDir.getAbsolutePath( ).matches( restrictionPattern ))
      {
        throw new InvalidConfigurationException(
            "Integration tests are configured to use '"
                + rootDir.getAbsolutePath( )
                + "' as the root directory. "
                + "This is a restricted directory that should not be used"
                + " for testing (the contents of this directory will be deleted)."
View Full Code Here


    {
  super( token, encryptionEnabled, encryptionProvider, requestExecutor, configProperties );
 
  if ( !configProperties.containsKey( LOCAL_ROOT_PROP ) )
  {
      throw new InvalidConfigurationException(
        "You must specify a local store root directory in order to use the local cloud store. Please update your config file." );
  }
 
  String rootDir = configProperties.getProperty( LOCAL_ROOT_PROP );
 
  // !! HACK ALERT !!
  // if the root directory is a drive letter (e.g. d:), then
  // we need to normalize it by adding a backslash (e.g. d:\)
  if ( rootDir.matches( "^\\s*[a-zA-Z]:\\s*" ) )
  {
      rootDir += "\\";
  }
  // also need to replace drive letters followed by forward slashes
  if ( rootDir.matches( "^\\s*[a-zA-Z]:/\\s*" ) )
  {
      rootDir.replace( '/', '\\' );
  }
 
  _root =
    new File( rootDir );
  if ( !_root.exists( ) )
  {
    FileUtil.mkdir( _root );
  }
  if ( !_root.isDirectory( ) )
  {
      throw new InvalidConfigurationException(
        "Local root path, '" + _root.getAbsolutePath( )
        + "', is not a directory." );
  }
 
  _pathNormalizer = new LocalCloudStorePathNormalizer( _root );
View Full Code Here

    {
      setupEncryption( config );
    }
      catch (IOException e)
    {
      throw new InvalidConfigurationException("Could not read config file: " + e.getMessage( ), e);
    }
    }
View Full Code Here

      }
     
    File keyDirectory = new File( encryptionConfig.getKeyDirectory( ) );
      if ( !keyDirectory.exists( ) || !keyDirectory.isDirectory( ) )
      {
      throw new InvalidConfigurationException(
        "Could not find encryption key directory '"
        + keyDirectory.getAbsolutePath( ) + "'." );
      }
     
      try
      {
      _encryptionProvider = EncryptionProviderBuilder
        .buildProvider( keyDirectory, encryptionConfig.getPreferredKey( ) );
      }
      catch ( NoSuchAlgorithmException e )
      {
        throw new InvalidConfigurationException( e );
      }
     
      _encryptionProvider.setCipher( config.getEncryption( ).getCipher( ) );
      _providerFactory.setEncryption( _encryptionProvider );
    }
View Full Code Here

    protected static void assertConfigPropExists( Properties configProperties,
              String propName )
    {
  if ( !configProperties.containsKey( propName ) )
  {
      throw new InvalidConfigurationException(
        "Missing config property, " + propName
        + ". Can't configure the CloudStore." );
  }
    }
View Full Code Here

    {
  for ( String regex : validationRegex )
  {
      if ( !propVal.matches( regex ) )
      {
    throw new InvalidConfigurationException(
      "Invalid config property, "
        + propName
        + ". Please see provider docs for info on naming constraints. "
        + " Can't configure the CloudStore.\n" + errMsg );
      }
View Full Code Here

TOP

Related Classes of com.cloudloop.config.exceptions.InvalidConfigurationException

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.