Path objects
Note that some assertions have two versions: a normal one and a "raw" one (for instance, hasParent() and
hasParentRaw(). The difference is that normal assertions will canonicalize or normalize the tested path and, where applicable, the path argument, before
performing the actual test. Canonicalization includes normalization.
Canonicalization may lead to an I/O error if a path does not exist, in which case the given assertions will fail with
a PathsException. Also note that symbolic links will be followed if the
filesystem supports them. Finally, if a path is not absolute, canonicalization will
resolve the path against the process' current working directory.
These assertions are filesystem independent. You may use them on Path instances issued from the default
filesystem (ie, instances you get when using java.) or from other
filesystems. For more information, see the javadoc for FileSystem.
Furthermore:
null arguments; if a null
argument is passed, these assertions will throw a NullPointerException.closed. If a filesystems is closed, assertions will throw a
ClosedFileSystemException.Path as an argument. If this path is not issued from the same
provider as the tested path, assertions will throw a ProviderMismatchException.PathsException.Path, java.nio.file.Paths#get(String, String...) , FileSystem, FileSystem#getPath(String, String...) , java.nio.file.FileSystems#getDefault() , Files
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Charset | |
| protected Paths |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public AbstractByteArrayAssert | Returns: aAbstractByteArrayAssert object with the binary content of the path.Returns |
| public AbstractStringAssert | |
| public AbstractStringAssert | |
| public SELF | |
| public SELF | |
| public SELF | Returns: selfthe other path other)Assert that the tested |
| public SELF | Returns: selfAssert that the tested Note that this assertion will follow symbolic links before asserting the path's existence. |
| public SELF | Returns: selfAssert that the tested |
| public SELF | Returns: this assertion object.the expected binary content to compare the actual expected)Path's content to.Verifies that the binary content of the actual |
| public SELF | Returns: this assertion object.the expected text content to compare the actual expected)Path's content to.Verifies that the text content of the actual |
| public SELF | Returns: this assertion object.the MessageDigest used to calculate the digests. digest, byte[] the expected binary content to compare the actual expected)Path's content to.Verifies that the tested |
| public SELF | Returns: this assertion object.the MessageDigest used to calculate the digests. digest, String the expected binary content to compare the actual expected)Path's content to.Verifies that the tested |
| public SELF | Returns: this assertion object.the algorithm used to calculate the digests to compare. algorithm, byte[] the expected binary content to compare the actual expected)Path's content to.Verifies that the tested |
| public SELF | |
| public SELF | Returns: this assertion object.the expected extension, without the expectedExtension)'.'.Verifies that the actual |
| public SELF | Returns: selfthe expected filename fileName)Assert that the tested |
| public SELF | Returns: this assertion object.the given expected)FileSystem to compare the actual Path file system to.Verifies that the path has the given file system. |
| public SELF | |
| public SELF | |
| public SELF | |
| public SELF | |
| public SELF | Returns: selfthe expected parent path expected)Assert that the tested |
| public SELF | Returns: this assertion object.the given expected)Path to compare the actual Path to.Verifies that the content of the actual |
| public SELF | Returns: this assertion object.the given expected)Path to compare the actual Path to.
Deprecated
use
hasSameTextualContentAs(Path) instead
Verifies that the content of the actual |
| public SELF | Returns: this assertion object.the given expected, Charset Path to compare the actual Path to.the expectedCharset)Charset used to read the content of the expected Path.
Deprecated
use
hasSameTextualContentAs(Path, Charset) instead
Verifies that the content of the actual |
| public SELF | Returns: this assertion object.the given expected)Path to compare the actual Path file system to.Verifies that the path file system is the same as the given path file system. |
| public SELF | Returns: this assertion object.the given expected)Path to compare the actual Path to.Verifies that the content of the actual |
| public SELF | Returns: this assertion object.the given expected, Charset Path to compare the actual Path to.the expectedCharset)Charset used to read the content of the expected Path.Verifies that the content of the actual |
| public SELF | |
| private AbstractStringAssert | |
| public SELF | |
| public SELF | Returns: selfAssert that the tested |
| public SELF | |
| public SELF | Returns: this assertion object.the filter for files located inside filter)actual's directory.Verify that the actual |
| public SELF | Returns: this assertion object.the syntax and pattern for syntaxAndPattern)java. as described in FileSystem#getPathMatcher(String).Verify that the actual |
| public SELF | Returns: this assertion object.the filter for files located inside filter)actual's directory.Verify that the actual |
| public SELF | Returns: this assertion object.the syntax and pattern for syntaxAndPattern)java. as described in FileSystem#getPathMatcher(String).Verify that the actual |
| public SELF | Returns: this assertion object.the syntax and pattern for syntaxAndPattern)java. as described in FileSystem#getPathMatcher(String).Verify that the actual |
| public SELF | Returns: this assertion object.the filter for files located inside filter)actual's directory.Verify that the actual |
| public SELF | |
| public SELF | |
| public SELF | Returns: selfAssert that the tested |
| public SELF | |
| public SELF | Returns: this assertion object.Verify that the actual |
| public SELF | Returns: this assertion object.Verify that the actual |
| public SELF | Returns: selfAssert that the tested |
| public SELF | |
| public SELF | |
| public SELF | |
| public SELF | Returns: selfAssert that the tested |
| private byte[] | |
| private String | |
| public SELF | Returns: selfthe other path other)Assert that the tested |
| public SELF | Returns: selfthe other path other)Assert that the tested |
| public SELF | Returns: this assertion object.the name of the charset to use. charsetName)Specifies the name of the charset to use for text-based assertions on the path's contents (path must be a readable file). |
| public SELF | Returns: this assertion object.the charset to use. charset)Specifies the charset to use for text-based assertions on the path's contents (path must be a readable file). |