public int getDepth() {
    String path = mUri.getPath();
    if (path.isEmpty() || CUR_DIR.equals(path)) {
      return 0;
    }
    if (hasWindowsDrive(path, true)) {
      path = path.substring(3);
    }

    int depth = 0;

    int slash = path.length() == 1 && path.charAt(0) == '/' ? -1 : 0;
    while (slash != -1) {
      depth++;
      slash = path.indexOf(SEPARATOR, slash + 1);
    }
    return depth;
  }
@Test
  public void getDepthTests() {
    assertEquals(0, new AlluxioURI("").getDepth());
    assertEquals(0, new AlluxioURI(".").getDepth());
    assertEquals(0, new AlluxioURI("/").getDepth());
    assertEquals(1, new AlluxioURI("/a").getDepth());
    assertEquals(3, new AlluxioURI("/a/b/c.txt").getDepth());
    assertEquals(2, new AlluxioURI("/a/b/").getDepth());
    assertEquals(2, new AlluxioURI("a\\b").getDepth());
    assertEquals(1, new AlluxioURI("C:\\a").getDepth());
    assertEquals(1, new AlluxioURI("C:\\\\a").getDepth());
    assertEquals(0, new AlluxioURI("C:\\\\").getDepth());
    assertEquals(0, new AlluxioURI("alluxio://localhost:19998/").getDepth());
    assertEquals(1, new AlluxioURI("alluxio://localhost:19998/a").getDepth());
    assertEquals(2, new AlluxioURI("alluxio://localhost:19998/a/b.txt").getDepth());
  }