Class FileSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.FileSource
-
- All Implemented Interfaces:
java.io.Serializable,FileSystemSource,UriSource,TestSource
@API(status=STABLE, since="1.0") public class FileSource extends java.lang.Object implements FileSystemSourceFile basedTestSourcewith an optional position.- Since:
- 1.0
- See Also:
FileSelector, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static FileSourcefrom(java.io.File file)Create a newFileSourceusing the suppliedfile.static FileSourcefrom(java.io.File file, FilePosition filePosition)java.io.FilegetFile()Get the source file.java.util.Optional<FilePosition>getPosition()Get theFilePosition, if available.java.net.URIgetUri()Get theURIfor the source file.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
from
public static FileSource from(java.io.File file)
Create a newFileSourceusing the suppliedfile.- Parameters:
file- the source file; must not benull
-
from
public static FileSource from(java.io.File file, FilePosition filePosition)
- Parameters:
file- the source file; must not benullfilePosition- the position in the source file; may benull
-
getUri
public final java.net.URI getUri()
Get theURIfor the source file.
-
getFile
public final java.io.File getFile()
Get the source file.- Specified by:
getFilein interfaceFileSystemSource- Returns:
- the source file; never
null
-
getPosition
public final java.util.Optional<FilePosition> getPosition()
Get theFilePosition, if available.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-