FileSystems { public static ResourceId matchNewResource(String singleResourceSpec, boolean isDirectory) { return getFileSystemInternal(parseScheme(singleResourceSpec)) .matchNewResource(singleResourceSpec, isDirectory); }  static boolean hasGlobWildcard(String spec); static List<MatchResult> match(List<String> specs); static List<MatchResult> match(List<String> specs, EmptyMatchTreatment emptyMatchTreatment); static MatchResult match(String spec); static MatchResult match(String spec, EmptyMatchTreatment emptyMatchTreatment); static Metadata matchSingleFileSpec(String spec); static List<MatchResult> matchResources(List<ResourceId> resourceIds); static WritableByteChannel create(ResourceId resourceId, String mimeType); static WritableByteChannel create(ResourceId resourceId, CreateOptions createOptions); static ReadableByteChannel open(ResourceId resourceId); static void copy(
      List<ResourceId> srcResourceIds, List<ResourceId> destResourceIds, MoveOptions... moveOptions); static void rename(
      List<ResourceId> srcResourceIds, List<ResourceId> destResourceIds, MoveOptions... moveOptions); static void delete(Collection<ResourceId> resourceIds, MoveOptions... moveOptions); @Internal static void setDefaultPipelineOptions(PipelineOptions options); static ResourceId matchNewResource(String singleResourceSpec, boolean isDirectory); static final String DEFAULT_SCHEME; }
@Test public void testValidMatchNewResourceForLocalFileSystem() { assertEquals("file", FileSystems.matchNewResource("/tmp/f1", false).getScheme()); assertEquals("file", FileSystems.matchNewResource("tmp/f1", false).getScheme()); assertEquals("file", FileSystems.matchNewResource("c:\\tmp\\f1", false).getScheme()); }
@Test(expected = IllegalArgumentException.class) public void testInvalidSchemaMatchNewResource() { assertEquals("file", FileSystems.matchNewResource("invalidschema: assertEquals("file", FileSystems.matchNewResource("c:/tmp/f1", false)); }