FilePathReader

Methods to read files on the FileSystem

Companion:
object
class Object
trait Matchable
class Any
object FilePathReader.type
object FileSystem.type

Value members

Concrete methods

def doesNotExist(filePath: FilePath): Operation[Boolean]
Returns:

true if the file doesn't exist

def doesNotExist(directoryPath: DirectoryPath): Operation[Boolean]
Returns:

true if the directory doesn't exist

def exists(filePath: FilePath): Operation[Boolean]
Returns:

true if the file exists

def exists(directoryPath: DirectoryPath): Operation[Boolean]
Returns:

true if the directory exists

def filePaths(dir: DirectoryPath, glob: String, verbose: Boolean): Operation[List[FilePath]]
Returns:

the list of file paths accessible from dir

def filterWithPattern(pattern: String): FilePath => Boolean

filter files according to a regex pattern

filter files according to a regex pattern

def globToPattern(glob: String): String
Returns:

the regular expression equivalent to a glob pattern (see the specs for Fragments)

Returns:

the files directly accessible from a directory

def listDirectFilePaths(directory: DirectoryPath): Operation[IndexedSeq[FilePath]]
Returns:

the files directly accessible from a directory

Returns:

the files accessible recursively from a directory

def md5(filePath: FilePath): Operation[String]
Returns:

the MD5 hash of a file

def mustBeADirectory(file: File): Operation[Unit]

succeeds if the file is a directory

succeeds if the file is a directory

def mustExist(file: File): Operation[Unit]

succeeds if the file exists

succeeds if the file exists

def mustNotBeADirectory(file: File): Operation[Unit]

succeeds if the file is not a directory

succeeds if the file is not a directory

def readBytes(filePath: FilePath): Operation[Array[Byte]]

read the content of a file as an Array of Bytes

read the content of a file as an Array of Bytes

def readFile(path: FilePath): Operation[String]
Returns:

the content of a file encoded as UTF8

def readFileWithCodec(path: FilePath, codec: Codec): Operation[String]
Returns:

the content of a file with a specific codec

def readLines(filePath: FilePath): Operation[IndexedSeq[String]]
Returns:

the content of a file as UTF-8 lines

def readLinesWithCodec(filePath: FilePath, codec: Codec): Operation[IndexedSeq[String]]
Returns:

the content of a file with a specific codec