Package org.hamcrest.io
Class FileMatchers
java.lang.Object
org.hamcrest.io.FileMatchers
Matchers for properties of files.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final FileMatchers.FileStatus
Checks if aFile
is readable.static final FileMatchers.FileStatus
Checks if aFile
is writable.static final FileMatchers.FileStatus
Checks if aFile
is a exists.static final FileMatchers.FileStatus
Checks if aFile
is a directory.static final FileMatchers.FileStatus
Checks if aFile
is a file. -
Method Summary
Modifier and TypeMethodDescriptionaFileNamed
(Matcher<String> expected) A matcher that checks if a file name matches an expected name.aFileWithAbsolutePath
(Matcher<String> expected) A matcher that checks if a file absolute path matches an expected path.aFileWithCanonicalPath
(Matcher<String> expected) A matcher that checks if a file canonical path matches an expected path.aFileWithSize
(long size) A matcher that checks if a file has a specific size.aFileWithSize
(Matcher<Long> expected) A matcher that checks if a file size matches an expected size.A matcher that checks if a directory exists.A matcher that checks if a file exists.A matcher that checks if a file or directory exists.A matcher that checks if a file is readable.A matcher that checks if a directory is writable.
-
Field Details
-
Method Details
-
anExistingDirectory
A matcher that checks if a directory exists.- Returns:
- the file matcher
-
anExistingFileOrDirectory
A matcher that checks if a file or directory exists.- Returns:
- the file matcher
-
anExistingFile
A matcher that checks if a file exists.- Returns:
- the file matcher
-
aReadableFile
A matcher that checks if a file is readable.- Returns:
- the file matcher
-
aWritableFile
A matcher that checks if a directory is writable.- Returns:
- the file matcher
-
aFileWithSize
A matcher that checks if a file has a specific size.- Parameters:
size
- the expected size- Returns:
- the file matcher
-
aFileWithSize
A matcher that checks if a file size matches an expected size.- Parameters:
expected
- matcher for the expected size- Returns:
- the file matcher
-
aFileNamed
A matcher that checks if a file name matches an expected name.- Parameters:
expected
- the expected name- Returns:
- the file matcher
-
aFileWithCanonicalPath
A matcher that checks if a file canonical path matches an expected path.- Parameters:
expected
- the expected path- Returns:
- the file matcher
-
aFileWithAbsolutePath
A matcher that checks if a file absolute path matches an expected path.- Parameters:
expected
- the expected path- Returns:
- the file matcher
-