FileSystems { @VisibleForTesting static FileSystem getFileSystemInternal(String scheme) { String lowerCaseScheme = scheme.toLowerCase(); Map<String, FileSystem> schemeToFileSystem = SCHEME_TO_FILESYSTEM.get(); FileSystem rval = schemeToFileSystem.get(lowerCaseScheme); if (rval == null) { throw new IllegalArgumentException("No filesystem found for scheme " + scheme); } return rval; }  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 testGetLocalFileSystem() throws Exception { assumeFalse(SystemUtils.IS_OS_WINDOWS); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("~/home/").getScheme()) instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("file: instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("FILE: instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("File: instanceof LocalFileSystem); if (SystemUtils.IS_OS_WINDOWS) { assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("c:\\home\\").getScheme()) instanceof LocalFileSystem); } }
@Test public void testGetLocalFileSystem() throws Exception { assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("~/home/").getScheme()) instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("file: instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("FILE: instanceof LocalFileSystem); assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("File: instanceof LocalFileSystem); if (SystemUtils.IS_OS_WINDOWS) { assertTrue( FileSystems.getFileSystemInternal(toLocalResourceId("c:\\home\\").getScheme()) instanceof LocalFileSystem); } }