Package com.cloudloop.storage.internal

Examples of com.cloudloop.storage.internal.CloudStoreObjectMetadata


      setMetadataHeadersOnRequest( file.getDirtyMetadata( ), request );
  }
  request.execute( );
  GetObjMetadataResponse response = new GetObjMetadataResponse( request
    .getResponseHeaders( ) );
  CloudStoreObjectMetadata responseMetadata = response.getMetadata( );
  responseMetadata.setComplete( );
  file.setMetadata( responseMetadata );
    }
View Full Code Here


  request.setContentLength( 0 );
  request.setContentType( "" );
  InputStream output = request.execute( );
  GetObjMetadataResponse response = new GetObjMetadataResponse( request
    .getResponseHeaders( ) );
  CloudStoreObjectMetadata responseMetadata = response.getMetadata( );
  responseMetadata.setComplete( );
  file.setMetadata( responseMetadata );
  return output;
    }
View Full Code Here

  request.setBucket( _bucket );
  request.setResource( obj.getPath( ).getAbsolutePath( ) );
  request.execute( );
  GetObjMetadataResponse response = new GetObjMetadataResponse( request
    .getResponseHeaders( ) );
  CloudStoreObjectMetadata responseMetadata = response.getMetadata( );
  responseMetadata.setComplete( );
  return responseMetadata;
    }
View Full Code Here

  catch ( ParseException e )
  {
      throw new ProviderRequestException( e );
  }
 
  CloudStoreObjectMetadata output = new CloudStoreObjectMetadata( );
  output.setContentLengthInBytes( pathInfo.getSizeBytes( ) );
  output.setLastModifiedDate( pathInfo.getLastModified( ) );
 
  Map<String, String> decodedMeta = new HashMap<String, String>( pathInfo
    .getMetadata( ) );
  for ( String key : pathInfo.getMetadata( ).keySet( ) )
  {
      String decodedVal = StringUtil.unescape( pathInfo.getMetadata( )
        .get( key ) );
      decodedMeta.put( key, decodedVal );
  }
  output.setCustomTags( decodedMeta );
 
  // Nirvanix sends the MD5 hash back as a meta-data tag, so
  // we need to do a bit of work to dig it out.
  for ( String key : output.getCustomTags( ).keySet( ) )
  {
      if ( key.equals( "MD5" ) )
      {
    output.setETag( output.getCustomTags( ).get( key ) );
      }
  }
 
  output.setComplete( );
  return output;
    }
View Full Code Here

    encodedMetadata.put( key, encodedVal );
      }
     
      _session.setMetadata( obj.getPath( ).getAbsolutePath( ),
          encodedMetadata );
      CloudStoreObjectMetadata refreshed = sendRefreshMetadataRequest( obj );
      refreshed.setComplete( );
      return refreshed;
  }
  catch ( SDKException e )
  {
      throw new ProviderRequestException( e );
View Full Code Here

      getDirectory(
      getPathNormalizer( )
      .normalizeToCloudStorePath( childFolder.getPath( ),
                true ).getAbsolutePath( )
      );
    CloudStoreObjectMetadata metadata = new CloudStoreObjectMetadata( );
    metadata.setLastModifiedDate( childFolder.getCreatedDate( ) );
    outputDir.setMetadata( metadata );
    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++;
      }
  }
View Full Code Here

   
    public void setCustomMetaTag( String key, String value )
    {
  if ( _dirtyMetadata == null )
  {
      _dirtyMetadata = new CloudStoreObjectMetadata( );
  }
  _dirtyMetadata.setCustomTag( key, value );
    }
View Full Code Here

      // we need to set two important pieces of meta-data:
      // the salt value used for encrypting this file, and
      // an MD5 hash of the key used to encrypt it.
      String salt = ciphertext.getSaltAsString( );
      String keyMD5 = ciphertext.getKeyMD5( );
      CloudStoreObjectMetadata meta = file.getMetadata( );
      meta.setEncryptionSalt( salt );
      meta.setDecryptionKeyHash( keyMD5 );
      file.setDirtyMetadata( meta );
  }
 
  if ( progressObserver != null )
  {
View Full Code Here

    {
 
  assertObjectBelongsToStore( obj );
  assertObjectExistsInStore( obj );
 
  CloudStoreObjectMetadata refreshed = refreshMetadataAndSetComplete( obj );
  return refreshed;
    }
View Full Code Here

    }
   
    private void writeAndRefreshMetadata( CloudStoreObject obj,
            CloudStoreObjectMetadata metadata )
    {
  CloudStoreObjectMetadata written = sendWriteMetadataRequest( obj,
                     metadata );
  written.setComplete( );
  obj.setMetadata( written );
    }
View Full Code Here

TOP

Related Classes of com.cloudloop.storage.internal.CloudStoreObjectMetadata

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.