Package com.cloudloop.storage

Examples of com.cloudloop.storage.CloudStoreFile


    @Override
    public void sendIntraStoreCopyRequest(
             CloudStoreFile fromFile,
             CloudStoreDirectory toDirectory )
    {
  CloudStoreFile toFile = getFile( toDirectory.getPath( )
    .combine( PathUtil.popLeaf( fromFile.getPath( ) ) )
    .getAbsolutePath( ) );
  sendIntraStoreCopyRequest( fromFile, toFile );
    }
View Full Code Here


    sendIntraStoreCopyRequest( (CloudStoreDirectory) child,
             newDirectory );
      }
      else
      {
    CloudStoreFile newFile = getFile( newPath.getAbsolutePath( ) );
    sendIntraStoreCopyRequest( (CloudStoreFile) child, newFile );
      }
  }
    }
View Full Code Here

      {
    sendIntraStoreCopyRequest( (CloudStoreDirectory) child, newDir );
      }
      else
      {
    CloudStoreFile newFile = getFile( newPath.getAbsolutePath( ) );
    sendIntraStoreCopyRequest( (CloudStoreFile) child, newFile );
      }
  }
  sendRemoveDirectoryRequest( directory, true );
    }
View Full Code Here

   
    @Override
    public CloudStoreDirectory sendCreateDirectoryRequest(
                 CloudStoreDirectory directory )
    {
  CloudStoreFile placeholder = new FakeDirectoryPlaceholder( this,
    directory.getPath( ) );
  placeholder.write( null );
 
  return directory;
    }
View Full Code Here

        }
    }
      }
      else
      {
    CloudStoreFile file =
      getFile(
      _pathNormalizer
      .normalizeToCloudStorePath(
                child.getAbsolutePath( ),
                false ).getAbsolutePath( )
      );
    file.setMetadata( meta );
    if ( passesTypeFilter( file, typeFilter ) )
    {
        cloudStoreObjects.add(

        file
View Full Code Here

    public void testMoveTopLevelFileToLowerLevel( )
    {
  // create a random file directly in root dir
  String randomFileName = "adqsflkj82u88y8y8fjahdsfjheydjskl.foo";
  String randomDirName = "238787878ewafhjsdhagq7yuhasdo909";
  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

      sendIntraStoreCopyRequest(
               fromFile,
               getDirectory( targetDirPath
        .getAbsolutePath( ) ) );
     
      CloudStoreFile copiedFile =
        getFile( targetDirPath.combine(
                PathUtil.popLeaf( fromFile
        .getPath( ) ) )
        .getAbsolutePath( )
        );
     
      rename( copiedFile, toFile.getPath( ).getLeaf( ) );
  }
  else
  {
      // HACK!! THIS COULD BE SLOW!!
      // TODO: Get rid of this when Nirvanix introduces the ability to
      // copy files within the same folder.
      CloudStoreDirectory mutualParent = toFile.getParentDirectory( );
      CloudStoreFile newFile =
        getFile(
        mutualParent.getPath( ).combine(
                 PathUtil.popLeaf( toFile
        .getPath( ) )
        ).getAbsolutePath( )
        );
      newFile.setStreamToStore( fromFile.read( null ) );
      newFile.write( null );
  }
    }
View Full Code Here

    output.add( outputDir );
    numProcessed++;
      }
      for ( File childFile : folder.getFiles( ) )
      {
    CloudStoreFile outputFile =
      getFile(
      getPathNormalizer( )
      .normalizeToCloudStorePath( childFile.getPath( ), false )
      .getAbsolutePath( )
      );
    CloudStoreObjectMetadata metadata = new CloudStoreObjectMetadata( );
    MetadataInfo[ ] nirvanixMetadata = childFile.getMetadata( );
    for ( MetadataInfo info : nirvanixMetadata )
    {
        metadata.setCustomTag( info.getType( ), info.getValue( ) );
        if ( info.getType( ).equals( "MD5" ) )
        {
      metadata.setETag( info.getValue( ) );
        }
    }
    metadata.setContentLengthInBytes( childFile.getSizeBytes( ) );
    metadata.setLastModifiedDate( childFile.getCreatedDate( ) );
    metadata.isComplete( );
    outputFile.setMetadata( metadata );
    output.add( outputFile );
    numProcessed++;
      }
  }
  while ( folder.getTotalFileCount( ) + folder.getTotalFolderCount( ) < numProcessed );
View Full Code Here

  {
      throw new InvalidPathException(
        "Path represents a directory location." );
  }
 
  return new CloudStoreFile( this, cloudPath );
    }
View Full Code Here

 
  if ( toStore.equals( this ) )
  {
      // if the target file is the source file,
      // then short-circuit
      CloudStoreFile toFile = getFile( toDirectory.getPath( )
        .combine(
            PathUtil.popLeaf( fromFile.getPath( ) ) )
        .getAbsolutePath( ) );
      if ( toFile.equals( fromFile ) )
      {
    return;
      }
     
      sendIntraStoreCopyRequest( fromFile, toDirectory );
View Full Code Here

TOP

Related Classes of com.cloudloop.storage.CloudStoreFile

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.