/** * Returns a write channel for the given {@link ResourceId} with {@link CreateOptions}. * * <p>The resource is not expanded; it is used verbatim. * * @param resourceId the reference of the file-like resource to create * @param createOptions the configuration of the create operation */ public static WritableByteChannel create(ResourceId resourceId, CreateOptions createOptions) throws IOException { return getFileSystemInternal(resourceId.getScheme()).create(resourceId, createOptions); }
/** * Returns a read channel for the given {@link ResourceId}. * * <p>The resource is not expanded; it is used verbatim. * * <p>If seeking is supported, then this returns a {@link java.nio.channels.SeekableByteChannel}. * * @param resourceId the reference of the file-like resource to open */ public static ReadableByteChannel open(ResourceId resourceId) throws IOException { return getFileSystemInternal(resourceId.getScheme()).open(resourceId); }
public MatchResult.Metadata apply(MatchResult.Metadata metadata) { ResourceId resourceId = metadata.resourceId(); System.out.println(resourceId.getScheme() + "://" + resourceId.getCurrentDirectory() + resourceId.getFilename()); return metadata; } }));
@Override public void validateOutputResourceSupported(ResourceId resourceId) { checkArgument( "gs".equals(resourceId.getScheme()), "Expected a valid 'gs://' path but was given: '%s'", resourceId); verifyPath(resourceId.toString()); }
return; getFileSystemInternal(srcToCopy.iterator().next().getScheme()).copy(srcToCopy, destToCopy);
return; getFileSystemInternal(srcToRename.iterator().next().getScheme()) .rename(srcToRename, destToRename);
@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()); }
return; getFileSystemInternal(resourceIdsToDelete.iterator().next().getScheme()) .delete(resourceIdsToDelete);