Package com.cloudloop.storage

Examples of com.cloudloop.storage.CloudStoreDirectory


 
  setupDirectoryForListTest( numSubDirs, numFiles, numSubSubObjects,
           baseDir );
 
  CloudStoreAdapterBase store = getCloudStoreAdapter( );
  CloudStoreDirectory dir = store.getDirectory( baseDir );
 
  dir.remove( true );
  assertFalse( dir.existsInStore( ) );
    }
View Full Code Here


    CloudStoreObjectMetadata objectMetadata = getMetaData( filesObject );
    CloudStoreObject cloudStoreObject;
    boolean isDir = filesObject.getName( ).endsWith( "/" );
    if ( isDir )
    {
        cloudStoreObject = new CloudStoreDirectory( this,
          new CloudStorePath( filesObject.getName( ) ) );
        if ( recursive )
        {
      cloudStoreObjects
        .addAll( Arrays
View Full Code Here

                   true );
 
  CloudStorePath newDirPath = toDirectory.getPath( )
    .combine(
        PathUtil.popLeaf( fromDirectory.getPath( ) ) );
  CloudStoreDirectory newDirectory = getDirectory( newDirPath
    .getAbsolutePath( ) );
  if ( !newDirectory.existsInStore( ) )
  {
      sendCreateDirectoryRequest( newDirectory );
  }
 
  for ( CloudStoreObject child : children )
View Full Code Here

 
  CloudStorePath newDirPath = directory.getParentDirectory( ).getPath( )
    .combine(
        new CloudStorePath( newName, true,
    PathUtil.ROOT_DIRECTORY ) );
  CloudStoreDirectory newDir = getDirectory( newDirPath.getAbsolutePath( ) );
  sendCreateDirectoryRequest( newDir );
 
  for ( CloudStoreObject child : children )
  {
      CloudStorePath newPath = PathUtil.replace( child.getPath( ),
View Full Code Here

   
    @Test
    public void testDeleteRootDirectory( )
    {
  _cloudStore.removeDirectory( _cloudStore.getDirectory( "/" ), true );
  CloudStoreDirectory root = _cloudStore.getDirectory( "/" );
  assertEquals( 0, root.listContents( true ).length );
    }
View Full Code Here

  CloudStoreFile file = _cloudStore.getFile( randomFileName );
  assertFalse( file.existsInStore( ) );
  file.setStreamToStore( new MockFileStream( 50 ) );
  file.write( null );
  assertTrue( file.existsInStore( ) );
  CloudStoreDirectory dir = _cloudStore.getDirectory( randomDirName );
  assertFalse( dir.existsInStore( ) );
  _cloudStore.createDirectory( _cloudStore.getDirectory( dir.getPath( )
    .getAbsolutePath( ) ) );
  CloudStoreFile newFile =
    _cloudStore.getFile( dir.getPath( )
    .combine( PathUtil.popLeaf( file.getPath( ) ) )
    .getAbsolutePath( ) );
  _cloudStore.moveFile( file, newFile );
  assertFalse( file.existsInStore( ) );
  assertTrue( newFile.existsInStore( ) );
View Full Code Here

      meta.setETag( "n/a" );
      meta.setComplete( );
     
      if ( child.isDirectory( ) )
      {
    CloudStoreDirectory dir =
      getDirectory(
      _pathNormalizer
      .normalizeToCloudStorePath(
                child.getAbsolutePath( ),
                true ).getAbsolutePath( )
      );
   
    dir.setMetadata( meta );
    if ( passesTypeFilter( dir, typeFilter ) )
    {
        cloudStoreObjects.add( dir );
    }
   
View Full Code Here

    }
   
    @Test
    public void testMoveDirectoryIntoItselfFails( )
    {
  CloudStoreDirectory dir = _cloudStore.getDirectory( "/foo/bar/" );
  _cloudStore.createDirectory( dir );
  boolean exThrown = false;
  try
  {
      _cloudStore.moveDirectory( dir, _cloudStore
View Full Code Here

      "Could not create copy target directory, '"
      + localToDirectory.getAbsolutePath( ) + "'." );
      }
  }
 
  CloudStoreDirectory toChildDir =
    getDirectory(
    _pathNormalizer
    .normalizeToCloudStorePath(
              localToDirectory.getAbsolutePath( ),
              true ).getAbsolutePath( )
View Full Code Here

    @Test
    public void testMoveTopLevelDirToLowerLevel( )
    {
  String randomDirName = "238787878ewafhjsdhagq7yuhasdo909";
  String newPath = "/67ryfhgft67ityuggjhjjkht677rtf/i8uyuyfdrsesdxcxcx9/";
  CloudStoreDirectory dir = _cloudStore.getDirectory( randomDirName );
  assertFalse( dir.existsInStore( ) );
  _cloudStore.createDirectory( dir );
  CloudStoreDirectory newDir = _cloudStore.getDirectory( newPath );
  _cloudStore.moveDirectory( dir, newDir );
 
  assertFalse( dir.existsInStore( ) );
  assertTrue( newDir.existsInStore( ) );
    }
View Full Code Here

TOP

Related Classes of com.cloudloop.storage.CloudStoreDirectory

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.