Package com.cloudloop.storage

Examples of com.cloudloop.storage.CloudStorePath


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


        );
  }
 
  public void testReplace_ValidReplacement()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/biz/bang/");
    CloudStorePath toReplace = new CloudStorePath("/foo/bar/");
    assertEquals(new CloudStorePath("/zoo/biz/bang/"),
        PathUtil.replace(
            path,
            toReplace,
            new CloudStorePath("/zoo/")
          )
        );
  }
View Full Code Here

    ///////////////////////////

  @Test
  public void testGetAbsolutePath()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/");
    assertEquals("/foo/bar/", path.getAbsolutePath());
   
    path = new CloudStorePath("/foo/./bar/");
    assertEquals("/foo/bar/", path.getAbsolutePath());

    path = new CloudStorePath("/foo/./biz/../bar/");
    assertEquals("/foo/bar/", path.getAbsolutePath());
   

    path = new CloudStorePath("/foo/./biz/../bar/somefile.txt");
    assertEquals("/foo/bar/somefile.txt", path.getAbsolutePath());
  }
View Full Code Here

    ///////////////////////////
 
  @Test
  public void testGetPathText()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/");
    assertEquals("/foo/bar/", path.getPathText());
   
    path = new CloudStorePath("/foo/./bar/");
    assertEquals("/foo/./bar/", path.getPathText());

    path = new CloudStorePath("/foo/./biz/../bar/");
    assertEquals("/foo/./biz/../bar/", path.getPathText());
   

    path = new CloudStorePath("/foo/./biz/../bar/somefile.txt");
    assertEquals("/foo/./biz/../bar/somefile.txt", path.getPathText());
  }
View Full Code Here

    ///////////////////////////

  @Test
  public void testIsAbsolutePath()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/");
    assertTrue(path.isAbsolutePath());
   
    path = new CloudStorePath("foo/bar/");
    assertFalse(path.isAbsolutePath());
  }
View Full Code Here

  }

  @Test
  public void testGetLeaf_NonRootDirectory()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/");
    String leaf = path.getLeaf();
    assertEquals( "bar/", leaf );
  }
View Full Code Here

  }

  @Test
  public void testGetLeaf_File()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/file.txt");
    String leaf = path.getLeaf();
    assertEquals( "file.txt", leaf );
  }
View Full Code Here

    ///////////////////////////

  @Test
  public void testGetParent_RootDirectory()
  {
    CloudStorePath parent = PathUtil.ROOT_DIRECTORY.getParent();
    assertEquals( PathUtil.ROOT_DIRECTORY, parent );
  }
View Full Code Here

  }

  @Test
  public void testGetParent_NonRootDirectory()
  {
    CloudStorePath path = new CloudStorePath("/foo/bar/");
    assertEquals( new CloudStorePath("/foo/"), path.getParent() );
  }
View Full Code Here

  }

  @Test
  public void testGetParent_ParentIsRoot()
  {
    CloudStorePath path = new CloudStorePath("/foo/");
    assertEquals( PathUtil.ROOT_DIRECTORY, path.getParent() );
  }
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.