@Public
@Unstable
public final class WrappedIO
extends java.lang.Object
The intent is to avoid the need for complex reflection operations including wrapping of parameter classes, direct instantiation of new classes etc.
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.List<java.util.Map.Entry<Path,java.lang.String>> |
bulkDelete_delete(FileSystem fs,
Path base,
java.util.Collection<Path> paths) |
Delete a list of files/objects.
|
static int |
bulkDelete_pageSize(FileSystem fs,
Path path) |
Get the maximum number of objects/files to delete in a single request.
|
static void |
byteBufferPositionedReadable_readFully(java.io.InputStream in,
long position,
java.nio.ByteBuffer buf) |
Delegate to
ByteBufferPositionedReadable.read(long, ByteBuffer). |
static boolean |
byteBufferPositionedReadable_readFullyAvailable(java.io.InputStream in) |
Probe to see if the input stream is an instance of ByteBufferPositionedReadable.
|
static Path |
fileSystem_getEnclosingRoot(FileSystem fs,
Path path) |
Return path of the enclosing root for a given path.
|
static FSDataInputStream |
fileSystem_openFile(FileSystem fs,
Path path,
java.lang.String policy,
FileStatus status,
java.lang.Long length,
java.util.Map<java.lang.String,java.lang.String> options) |
OpenFile assistant, easy reflection-based access to
FileSystem.openFile(Path) and blocks
awaiting the operation completion. |
static boolean |
pathCapabilities_hasPathCapability(java.lang.Object fs,
Path path,
java.lang.String capability) |
Does a path have a given capability?
Calls
PathCapabilities.hasPathCapability(Path, String),
mapping IOExceptions to false. |
static boolean |
streamCapabilities_hasCapability(java.lang.Object object,
java.lang.String capability) |
Does an object implement
StreamCapabilities and, if so,
what is the result of the probe for the capability?
Calls StreamCapabilities.hasCapability(String), |
public static int bulkDelete_pageSize(FileSystem fs, Path path)
fs - filesystempath - path to delete under.java.lang.UnsupportedOperationException - bulk delete under that path is not supported.java.lang.IllegalArgumentException - path not valid.java.io.UncheckedIOException - if an IOE was raised.public static java.util.List<java.util.Map.Entry<Path,java.lang.String>> bulkDelete_delete(FileSystem fs, Path base, java.util.Collection<Path> paths)
base.fs - filesystembase - path to delete under.paths - list of paths which must be absolute and under the base path.java.lang.UnsupportedOperationException - bulk delete under that path is not supported.java.io.UncheckedIOException - if an IOE was raised.java.lang.IllegalArgumentException - if a path argument is invalid.public static boolean pathCapabilities_hasPathCapability(java.lang.Object fs,
Path path,
java.lang.String capability)
PathCapabilities.hasPathCapability(Path, String),
mapping IOExceptions to false.fs - filesystempath - path to query the capability of.capability - non-null, non-empty string to query the path for support.java.lang.IllegalArgumentException - invalid argumentspublic static boolean streamCapabilities_hasCapability(java.lang.Object object,
java.lang.String capability)
StreamCapabilities and, if so,
what is the result of the probe for the capability?
Calls StreamCapabilities.hasCapability(String),object - object to probecapability - capability string@Stable public static FSDataInputStream fileSystem_openFile(FileSystem fs, Path path, java.lang.String policy, @Nullable FileStatus status, @Nullable java.lang.Long length, @Nullable java.util.Map<java.lang.String,java.lang.String> options)
FileSystem.openFile(Path) and blocks
awaiting the operation completion.fs - filesystempath - pathpolicy - read policystatus - optional file statuslength - optional file lengthoptions - nullable map of other optionsjava.io.UncheckedIOException - if an IOE was raised.public static Path fileSystem_getEnclosingRoot(FileSystem fs, Path path) throws java.io.IOException
fs - filesystempath - file path to find the enclosing root path forjava.io.IOException - early checks like failure to resolve path cause IO failurespublic static void byteBufferPositionedReadable_readFully(java.io.InputStream in,
long position,
java.nio.ByteBuffer buf)
ByteBufferPositionedReadable.read(long, ByteBuffer).in - input streamposition - position within filebuf - the ByteBuffer to receive the results of the read operation.
Note: that is the default behaviour of FSDataInputStream.readFully(long, ByteBuffer).public static boolean byteBufferPositionedReadable_readFullyAvailable(java.io.InputStream in)
in - input streamCopyright © 2008–2025 Apache Software Foundation. All rights reserved.