{
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 );