Package com.rackspacecloud.client.cloudfiles

Examples of com.rackspacecloud.client.cloudfiles.FilesClient


  int connectionTimeout = Integer.parseInt( configProperties
    .getProperty( "connection-timeout", "0" ) );
  if ( StringUtils.isNotBlank( login )
    && StringUtils.isNotBlank( apiAccessKey ) )
  {
      _client = new FilesClient( login, apiAccessKey );
      if ( connectionTimeout != 0 )
      {
    _client.setConnectionTimeOut( connectionTimeout );
      }
  }
View Full Code Here


    protected CloudStore createStore( )
    {
  String login = _testEnvironment.getRackspaceLogin( );
  String apiKey = _testEnvironment.getRackspaceApiKey( );
 
  _client = new FilesClient( login, apiKey );
 
  _rootContainer = _testEnvironment.getRackspaceRoot( );
 
  deleteContainerIfExists( _rootContainer );
 
View Full Code Here

  super.setUp( );
 
  String login = _testEnvironment.getRackspaceLogin( );
  String apiKey = _testEnvironment.getRackspaceApiKey( );
 
  _client = new FilesClient( login, apiKey );
 
  _rootContainer = _testEnvironment.getRackspaceRoot( );
 
  deleteContainerIfExists( _rootContainer );
 
View Full Code Here

  public String acl() {
    return "private";
  }
 
  public FilesClient cloudFilesConnection() {
    FilesClient conn = new FilesClient(username(), accessKeyID(), authUrl(), null, connectionTimeOut());
    try {
      conn.login();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    catch (HttpException e) {
View Full Code Here

    }
    return tempFile.getAbsolutePath();
  }
 
  public FilesClient cloudFilesConnection() {
    FilesClient conn = new FilesClient(username(), accessKeyID(), authUrl(), null, connectionTimeOut());
    try {
      conn.login();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
    catch (HttpException e) {
View Full Code Here

  }

  @Override
  public void deleteAttachment(ERCloudFilesAttachment attachment)
      throws MalformedURLException, IOException {
    FilesClient conn = attachment.cloudFilesConnection();
    String bucket = attachment.container();
    String key = attachment.key();
    try {
      conn.deleteObject(bucket, key);
    }
    catch (FilesNotFoundException e) {
      throw new IOException("Failed to delete '" + bucket + "/" + key
          + "' to CloudFiles: Error " + e.getHttpStatusCode()
          + ": " + e.getHttpStatusMessage());
View Full Code Here

  public void performUpload(File uploadedFile, String originalFileName,
      String bucket, String key, String mimeType,
      ERCloudFilesAttachment attachment) throws MalformedURLException,
      IOException {
    try {
      FilesClient conn = attachment.cloudFilesConnection();
      FileInputStream attachmentFileInputStream = new FileInputStream(
          uploadedFile);
      BufferedInputStream attachmentInputStream = new BufferedInputStream(
          attachmentFileInputStream);
      try {
        try {
          conn.storeObjectAs(bucket, uploadedFile, mimeType, key);
          URL pathToFile = new URL(conn.getStorageURL() + "/" + bucket + "/" + key);
          attachment.setCfPath(pathToFile.toExternalForm());
          attachment.setWebPath(pathToFile.getPath());
        }
        catch (FilesException e) {
          throw new IOException("Failed to write '" + bucket + "/"
View Full Code Here

TOP

Related Classes of com.rackspacecloud.client.cloudfiles.FilesClient

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.