Package org.apache.beam.sdk.io
Class ClassLoaderFileSystem.ClassLoaderResourceId
- java.lang.Object
-
- org.apache.beam.sdk.io.ClassLoaderFileSystem.ClassLoaderResourceId
-
- All Implemented Interfaces:
java.io.Serializable
,ResourceId
- Enclosing class:
- ClassLoaderFileSystem
public static class ClassLoaderFileSystem.ClassLoaderResourceId extends java.lang.Object implements ResourceId
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoaderFileSystem.ClassLoaderResourceId
getCurrentDirectory()
Returns theResourceId
that represents the current directory of thisResourceId
.@Nullable java.lang.String
getFilename()
Returns the name of the file or directory denoted by thisResourceId
.java.lang.String
getScheme()
Get the scheme which defines the namespace of theResourceId
.boolean
isDirectory()
Returnstrue
if thisResourceId
represents a directory, false otherwise.ClassLoaderFileSystem.ClassLoaderResourceId
resolve(java.lang.String other, ResolveOptions resolveOptions)
Returns a childResourceId
underthis
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.beam.sdk.io.fs.ResourceId
toString
-
-
-
-
Method Detail
-
resolve
public ClassLoaderFileSystem.ClassLoaderResourceId resolve(java.lang.String other, ResolveOptions resolveOptions)
Description copied from interface:ResourceId
Returns a childResourceId
underthis
.In order to write file system agnostic code, callers should not include delimiters in
other
, and should useResolveOptions.StandardResolveOptions
to specify whether to resolve a file or a directory.For example:
ResourceId homeDir = ...; ResourceId tempOutput = homeDir .resolve("tempDir", StandardResolveOptions.RESOLVE_DIRECTORY) .resolve("output", StandardResolveOptions.RESOLVE_FILE);
This
ResourceId
should represents a directory.It is up to each file system to resolve in their own way.
Resolving special characters:
resourceId.resolve("..", StandardResolveOptions.RESOLVE_DIRECTORY)
returns the parent directory of thisResourceId
.resourceId.resolve("*", StandardResolveOptions.RESOLVE_FILE)
returns aResourceId
which matches all files in thisResourceId
.resourceId.resolve("*", StandardResolveOptions.RESOLVE_DIRECTORY)
returns aResourceId
which matches all directories in thisResourceId
.
- Specified by:
resolve
in interfaceResourceId
-
getCurrentDirectory
public ClassLoaderFileSystem.ClassLoaderResourceId getCurrentDirectory()
Description copied from interface:ResourceId
Returns theResourceId
that represents the current directory of thisResourceId
.If it is already a directory, trivially returns this.
- Specified by:
getCurrentDirectory
in interfaceResourceId
-
getScheme
public java.lang.String getScheme()
Description copied from interface:ResourceId
Get the scheme which defines the namespace of theResourceId
.The scheme is required to follow URI scheme syntax. See RFC 2396
- Specified by:
getScheme
in interfaceResourceId
-
getFilename
public @Nullable java.lang.String getFilename()
Description copied from interface:ResourceId
Returns the name of the file or directory denoted by thisResourceId
. The file name is the farthest element from the root in the directory hierarchy.- Specified by:
getFilename
in interfaceResourceId
- Returns:
- a string representing the name of file or directory, or null if there are zero components.
-
isDirectory
public boolean isDirectory()
Description copied from interface:ResourceId
Returnstrue
if thisResourceId
represents a directory, false otherwise.- Specified by:
isDirectory
in interfaceResourceId
-
-