Package com.cloudloop.storage

Examples of com.cloudloop.storage.CloudStorePath


  boolean appendSlash = false;
  if ( directory && !storePath.endsWith( "/" ) )
  {
      appendSlash = true;
  }
  return new CloudStorePath( "/" + storePath.substring( _truncationIdx )
    + ( appendSlash ? "/" : "" ) );
    }
View Full Code Here


    }
   
    @Override
    public InputStream sendDownloadRequest( CloudStoreFile file )
    {
  CloudStorePath path = file.getPath( );
  AmazonS3AuthenticatedRESTRequest request = new AmazonS3AuthenticatedRESTRequest(
    _key, HTTPMethod.GET, _useHttps );
  request.setBucket( _bucket );
  request.setResource( path.getAbsolutePath( ) );
  request.setContentLength( 0 );
  request.setContentType( "" );
  InputStream output = request.execute( );
  GetObjMetadataResponse response = new GetObjMetadataResponse( request
    .getResponseHeaders( ) );
View Full Code Here

    @Override
    public void sendRemoveDirectoryRequest(
              CloudStoreDirectory directory,
              boolean recursive )
    {
  CloudStorePath path = directory.getPath( );
  try
  {
      _session.deleteFolders(
        new String[ ]
        { path.getAbsolutePath( ) } );
  }
  catch ( NirvanixException e )
  {
      throw new ProviderRequestException( e );
  }
View Full Code Here

   
    @Override
    public void sendRemoveFileRequest(
               CloudStoreFile file )
    {
  CloudStorePath path = file.getPath( );
  try
  {
      _session.deleteFiles(
        new String[ ]
        { path.getAbsolutePath( ) } );
  }
  catch ( NirvanixException e )
  {
      throw new ProviderRequestException( e );
  }
View Full Code Here

  // Nirvanix has no way to clone a file within the same
  // directory, so we have to do this ourselves.
  if ( !toFile.getParentDirectory( )
    .equals( fromFile.getParentDirectory( ) ) )
  {
      CloudStorePath targetDirPath = toFile.getParentDirectory( )
        .getPath( );
      sendIntraStoreCopyRequest(
               fromFile,
               getDirectory( targetDirPath
        .getAbsolutePath( ) ) );
     
      CloudStoreFile copiedFile =
        getFile( targetDirPath.combine(
                PathUtil.popLeaf( fromFile
        .getPath( ) ) )
        .getAbsolutePath( )
        );
     
View Full Code Here

        if ( !storePath.endsWith( "/" ) )
        {
            storePath += ( directory ? "/" : "" );
        }

        return new CloudStorePath( storePath );
    }
View Full Code Here

    expected.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    expected.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    expected.push( new CloudStorePathNode("bang", PathNodeType.DIRECTORY ) );   
   
    Stack<CloudStorePathNode> stack =
      PathUtil.convertPathToStack("bat/bang/", true, new CloudStorePath("/foo/"));

    assertTrue( expected.equals(stack) );
  }
View Full Code Here

 
    ///////////////////////////
 
  public void testPopLeaf_RootDirectory()
  {
    CloudStorePath leaf = PathUtil.popLeaf(PathUtil.ROOT_DIRECTORY);
    assertEquals(PathUtil.ROOT_DIRECTORY, leaf);
  }
View Full Code Here

    assertEquals(PathUtil.ROOT_DIRECTORY, leaf);
  }
 
  public void testPopLeaf_NonRootDirectory()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/biz/");
    CloudStorePath leaf = PathUtil.popLeaf(path);
    assertEquals(new CloudStorePath("/biz/"), leaf);
  }
View Full Code Here

    assertEquals(new CloudStorePath("/biz/"), leaf);
  }
 
  public void testPopLeaf_File()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/biz.txt");
    CloudStorePath leaf = PathUtil.popLeaf(path);
    assertEquals(new CloudStorePath("/biz.txt"), leaf);
  }
View Full Code Here

TOP

Related Classes of com.cloudloop.storage.CloudStorePath

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.