public final class SystemPreconditions extends Object
When checking hosts, if either object does not provide a method to get the host directly, it is extracted from the object's URI. For file systems, this is the URI of the current default directory.
Modifier and Type | Method and Description |
---|---|
static void |
checkOpen(ExecutionSystem es)
Ensures that the given execution system is open.
|
static void |
checkOpen(FileSystem fs)
Ensures that the given file system is open.
|
static void |
checkSameHost(FileSystem fs,
ExecutionSystem es)
Ensures that the given file system and execution system refer to the same
host.
|
static void |
checkSameHost(Host host,
ExecutionSystem es)
Ensures that the given host is the same as the host of the given
execution system.
|
static void |
checkSameHost(Host host,
FileSystem fs)
Ensures that the given host is the same as the host of the given file
system.
|
static void |
checkSameHost(Path path,
ExecutionSystem es)
Ensures that the given path and execution system refer to the same host.
|
static void |
checkSameHost(Path p1,
Path p2)
Ensures that two paths refer to the same host.
|
public static void checkSameHost(Path path, ExecutionSystem es)
IllegalArgumentException
- if the hosts are not equalpublic static void checkSameHost(FileSystem fs, ExecutionSystem es)
IllegalArgumentException
- if the hosts are not equalpublic static void checkSameHost(Path p1, Path p2)
IllegalArgumentException
- if the hosts are not equalpublic static void checkSameHost(Host host, FileSystem fs)
IllegalArgumentException
- if the hosts are not equalpublic static void checkSameHost(Host host, ExecutionSystem es)
IllegalArgumentException
- if the hosts are not equalpublic static void checkOpen(FileSystem fs)
IllegalArgumentException
- if the file system is closedpublic static void checkOpen(ExecutionSystem es)
IllegalArgumentException
- if the execution system is closed