Class ResourceFile
java.lang.Object
org.springframework.core.test.tools.DynamicFile
org.springframework.core.test.tools.ResourceFile
- All Implemented Interfaces:
org.assertj.core.api.AssertProvider<ResourceFileAssert>
public final class ResourceFile
extends DynamicFile
implements org.assertj.core.api.AssertProvider<ResourceFileAssert>
DynamicFile that holds resource file content and provides
ResourceFileAssert support.- Since:
- 6.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionUseassertThat(sourceFile)rather than calling this method directly.static ResourceFileFactory method to create a newResourceFilefrom the givenbyte[].static ResourceFileof(String path, CharSequence charSequence) Factory method to create a newResourceFilefrom the givenCharSequence.static ResourceFileof(String path, InputStreamSource inputStreamSource) Factory method to create a newResourceFilefrom the givenInputStreamSource.static ResourceFileof(String path, WritableContent writableContent) Factory method to create a newSourceFilefrom the givenWritableContent.Methods inherited from class org.springframework.core.test.tools.DynamicFile
equals, getBytes, getContent, getPath, hashCode, toString, toString
-
Method Details
-
of
Factory method to create a newResourceFilefrom the givenCharSequence.- Parameters:
path- the relative path of the file ornullto have the path deducedcharSequence- a char sequence containing the file contents- Returns:
- a
ResourceFileinstance
-
of
Factory method to create a newResourceFilefrom the givenbyte[].- Parameters:
path- the relative path of the file ornullto have the path deducedbytes- a byte array containing the file contents- Returns:
- a
ResourceFileinstance
-
of
Factory method to create a newResourceFilefrom the givenInputStreamSource.- Parameters:
path- the relative path of the fileinputStreamSource- the source for the file- Returns:
- a
ResourceFileinstance
-
of
Factory method to create a newSourceFilefrom the givenWritableContent.- Parameters:
path- the relative path of the filewritableContent- the content to write to the file- Returns:
- a
ResourceFileinstance
-
assertThat
UseassertThat(sourceFile)rather than calling this method directly.- Specified by:
assertThatin interfaceorg.assertj.core.api.AssertProvider<ResourceFileAssert>
-