Package com.google.common.jimfs.PathType

Examples of com.google.common.jimfs.PathType.ParseResult


      if (path.startsWith("$")) {
        root = "$";
        path = path.substring(1);
      }

      return new ParseResult(root, splitter().split(path));
    }
View Full Code Here


    assertThat(type.getOtherSeparators()).isEqualTo("\\");
  }

  @Test
  public void testParsePath() {
    ParseResult path = type.parsePath("foo/bar/baz/one\\two");
    assertParseResult(path, null, "foo", "bar", "baz", "one", "two");

    ParseResult path2 = type.parsePath("$one//\\two");
    assertParseResult(path2, "$", "one", "two");
  }
View Full Code Here

    assertParseResult(path2, "$", "one", "two");
  }

  @Test
  public void testToString() {
    ParseResult path = type.parsePath("foo/bar\\baz");
    assertThat(type.toString(path.root(), path.names())).isEqualTo("foo/bar/baz");

    ParseResult path2 = type.parsePath("$/foo/bar");
    assertThat(type.toString(path2.root(), path2.names())).isEqualTo("$foo/bar");
  }
View Full Code Here

    assertThat(result.root()).isEqualTo(root);
    assertThat(result.names()).containsExactly((Object[]) names).inOrder();
  }

  static void assertUriRoundTripsCorrectly(PathType type, String path) {
    ParseResult result = type.parsePath(path);
    URI uri = type.toUri(fileSystemUri, result.root(), result.names());
    ParseResult parsedUri = type.fromUri(uri);
    assertThat(parsedUri.root()).isEqualTo(result.root());
    assertThat(parsedUri.names()).containsExactlyElementsIn(result.names()).inOrder();
  }
View Full Code Here

TOP

Related Classes of com.google.common.jimfs.PathType.ParseResult

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.