Package com.cloudloop.storage.internal

Examples of com.cloudloop.storage.internal.CloudStorePathNode


  }
 
  public void testConvertPathToStack_NonRootRelativeDirectory()
  {
    Stack<CloudStorePathNode> expected = new Stack<CloudStorePathNode>();
    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 testConvertPathToStack_SlashOkayInFilename()
  {
    Stack<CloudStorePathNode> expected = new Stack<CloudStorePathNode>();
    expected.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    expected.push( new CloudStorePathNode("bang", PathNodeType.FILE ) );   
   
    Stack<CloudStorePathNode> stack =
      PathUtil.convertPathToStack("/bat/bang/", false, PathUtil.ROOT_DIRECTORY, true);

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

  }
 
  public void testConvertPathStackToString_DirectoryPath()
  {
    Stack<CloudStorePathNode> stack = new Stack<CloudStorePathNode>();
    stack.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bang", PathNodeType.DIRECTORY ) );
   
    String path =
      PathUtil.convertPathStackToString(
          stack, 0,
          stack.size() - 1,
View Full Code Here

  }
 
  public void testConvertPathStackToString_FilePath()
  {
    Stack<CloudStorePathNode> stack = new Stack<CloudStorePathNode>();
    stack.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bang", PathNodeType.FILE ) );
   
    String path =
      PathUtil.convertPathStackToString(
          stack, 0,
          stack.size() - 1,
View Full Code Here

  }
 
  public void testConvertPathStackToString_NonZeroStartIdx()
  {
    Stack<CloudStorePathNode> stack = new Stack<CloudStorePathNode>();
    stack.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bang", PathNodeType.FILE ) );
   
    String path =
      PathUtil.convertPathStackToString(
          stack, 1,
          stack.size() - 1,
View Full Code Here

  }
 
  public void testConvertPathStackToString_EndIdxLessThanStackLength()
  {
    Stack<CloudStorePathNode> stack = new Stack<CloudStorePathNode>();
    stack.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bang", PathNodeType.FILE ) );
   
    String path =
      PathUtil.convertPathStackToString(
          stack, 0,
          stack.size() - 2,
View Full Code Here

  }
 
  public void testConvertPathStackToString_NonPrefixedRelativePath()
  {
    Stack<CloudStorePathNode> stack = new Stack<CloudStorePathNode>();
    stack.push( new CloudStorePathNode("foo", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bat", PathNodeType.DIRECTORY ) );
    stack.push( new CloudStorePathNode("bang", PathNodeType.FILE ) );
   
    String path =
      PathUtil.convertPathStackToString(
          stack, 0,
          stack.size() - 1,
View Full Code Here

    : "" );
 
  int endPoint = Math.min( pathStackEndIdx, pathAsStack.size( ) - 1 );
  for ( int i = pathStackStartIdx; i <= endPoint; i++ )
  {
      CloudStorePathNode node = pathAsStack.get( i );
      output += node.getName( );
      if ( node.getNodeType( ) == PathNodeType.DIRECTORY )
    output += String.valueOf( PathUtil.PATH_SEPARATOR );
  }
 
  return output;
 
View Full Code Here

     
      if ( pathElement.equals( String.valueOf( CURRENT_DIR_SYMBOL ) ) )
    continue;
     
      // finally, push this node onto the stack
      CloudStorePathNode node =
        new CloudStorePathNode( pathElement, nodeType );
      pathStack.push( node );
  }
 
  return pathStack;
    }
View Full Code Here

  }
 
  Stack<CloudStorePathNode> replaced = new Stack<CloudStorePathNode>( );
  for ( int i = 0; i < pathStack.size( ); i++ )
  {
      CloudStorePathNode pathNode = pathStack.elementAt( i );
      if ( i < replacementStack.size( ) )
      {
    CloudStorePathNode replacementNode = replacementStack
      .elementAt( i );
    if ( !replacementNode.equals( pathNode ) )
    {
        return path;
    }
    else if ( i == replacementStack.size( ) - 1 )
    {
View Full Code Here

TOP

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

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.