Package com.cloudloop.storage

Examples of com.cloudloop.storage.CloudStore


    List<CloudStoreFile> files = new ArrayList<CloudStoreFile>( );

    for (String arg : args.getArguments())
    {
      CloudPath filePath = new CloudPath( arg , currentDir, CliSession.getSession( ).getCloudloop( ) );
      CloudStore store = (CloudStore) filePath.getCloudProvider( );
      CloudStoreFile file = store.getFile( filePath.getPath( ) );
      if (!file.existsInStore( ))
      {
        err.println( "File '" + filePath.getPath( )
            + "' does not exist in store '"
            + store.getCloudloopToken( ) + "'." );
        return 1;
      }
      files.add( file );
    }
View Full Code Here


        path = new CloudPath( arg , path , CliSession.getSession( )
            .getCloudloop( ) );
        pathInitialized = true;
    }

    CloudStore cloudStore = (CloudStore) path.getCloudProvider( );
    CloudStoreDirectory cloudStoreDirectory = cloudStore.getDirectory( path
        .getPath( ) );
    CloudStoreObject[] cloudStoreObjects = cloudStoreDirectory
        .listContents( recursive );

    for (CloudStoreObject cloudStoreObject : cloudStoreObjects)
View Full Code Here

    CloudPath path = new CloudPath( args.getArguments().get( 0 ) , CliSession.getSession( )
        .getCurrentDirectory( ) , CliSession.getSession( )
        .getCloudloop( ) );

    CloudStore cloudStore = (CloudStore) path.getCloudProvider( );
    cloudStore.createDirectory( cloudStore.getDirectory( path.getPath( ) ) );

    return 0;
  }
View Full Code Here

    // //////////////////// TESTS /////////////////////////
   
    @Test
    public void testCopyObjectsAcrossStores_toNirvanix( )
    {
  CloudStore nrvanix = _testEnvironment.getCloudloop( )
    .getStorage(
           TestEnvironment.NIRVANIX_TOKEN );
  _cloudStore.getDirectory( "/" ).copyTo( nrvanix.getDirectory( "/" ),
            null );
  assertDirContentState( "", "", _mockFs.Root, nrvanix );
  nrvanix.removeDirectory( nrvanix.getDirectory( "/" ), true );
    }
View Full Code Here

    // //////////////////// TESTS /////////////////////////
   
    @Test
    public void testCopyObjectsAcrossStores_toS3( )
    {
    CloudStore s3 = _testEnvironment.getCloudloop( ).getStorage( TestEnvironment.S3_TOKEN );
   
    _cloudStore.getDirectory( "/" ).copyTo( s3.getDirectory( "/" ), null );
    assertDirContentState( "", "", _mockFs.Root, s3 );
    s3.removeDirectory( s3.getDirectory( "/" ), true );
    }
View Full Code Here

    {
      path += "/";
    }
    CloudPath newDir = new CloudPath( path , currentDir, CliSession.getSession( ).getCloudloop( ) );

    CloudStore cloudStore = (CloudStore) newDir.getCloudProvider( );

    if (!cloudStore.getDirectory( newDir.getPath( ) ).existsInStore( ))
    {
      err.println( "Directory '" + newDir + "' does not exist in store '"
          + cloudStore.getCloudloopToken( ) + "'." );
      return 1;
    }

    CliSession.getSession( ).setCurrentDirectory( newDir );
    return 0;
View Full Code Here

    public static CloudStoreObject extractObject( CloudPath path,
                                                  boolean   preferDirectory )
    {
        assertValidCloudStorePath( path );

        CloudStore           parentStore = ( CloudStore ) path.getCloudProvider(  );

        CloudStoreObjectType objType     = CliUtil.determinePathType( path );

        switch ( objType )
        {
            case DIRECTORY :
                return parentStore.getDirectory( path.getPath(  ) );

            case FILE :
                return parentStore.getFile( path.getPath(  ) );

            case OBJECT :

                if ( preferDirectory )
                {
                    return parentStore.getDirectory( path.getPath(  ) );
                }
                else
                {
                    return parentStore.getFile( path.getPath(  ) );
                }

            default :
                throw new IllegalStateException( "Unknown object type '" + objType + "'." );
        }
View Full Code Here

    {
  assertObjectBelongsToStore( fromFile );
  assertObjectBelongsToStore( toFile );
  assertFileExistsInStore( fromFile );
 
  CloudStore toStore = toFile.getParentStore( );
 
  if ( !toStore.contains( toFile.getParentDirectory( ) ) )
  {
      toStore.createDirectory( toFile.getParentDirectory( ) );
  }
 
  if ( toStore.equals( this ) )
  {
      // if the source file is the same as the destination
      // file, then short circuit
      if ( fromFile.equals( toFile ) )
      {
View Full Code Here

    {
  assertObjectBelongsToStore( fromFile );
  assertObjectBelongsToStore( toDirectory );
  assertFileExistsInStore( fromFile );
 
  CloudStore toStore = toDirectory.getParentStore( );
 
  if ( !toStore.contains( toDirectory ) )
  {
      toStore.createDirectory( toDirectory );
  }
 
  if ( toStore.equals( this ) )
  {
      // if the target file is the source file,
      // then short-circuit
      CloudStoreFile toFile = getFile( toDirectory.getPath( )
        .combine(
View Full Code Here

    {
  assertObjectBelongsToStore( fromDirectory );
  assertObjectBelongsToStore( toDirectory );
  assertDirectoryExistsInStore( fromDirectory );
 
  CloudStore toStore = toDirectory.getParentStore( );
  toStore.createDirectory( toDirectory );
 
  if ( toStore.equals( this ) )
  {
      // if the source directory is the same as the target
      // directory, then short circuit
      CloudStoreDirectory targetDir = getDirectory( toDirectory.getPath( )
        .combine( PathUtil.popLeaf( fromDirectory.getPath( ) ) )
View Full Code Here

TOP

Related Classes of com.cloudloop.storage.CloudStore

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.