FilePath
classin packageklyn.io
public class FilePath extends Path:
└ FilePath
Represents a file path. The path may point to an existing file or to a file that will be created later.
Properties inherited from Path: cwd, exists, isAbsolute, isDirectory, isNormalized, isRegular, isSymlink, klynHome, lastModified, tempDir, userHome
Constructors
Modifier and Type Member Description
public FilePath
FilePath(base as FolderPath, names... as String):
Convenience overload when the base is already a FolderPath.
public FilePath
FilePath(base as Path, names... as String):
Creates a file path by resolving multiple child segments from a base path.
public FilePath
FilePath(filename as String):
Creates a file path wrapper from a path string.
public FilePath
FilePath(path as Path):
Creates a file path wrapper from another path instance.
Methods
Modifier and Type Member Description
public openInputStream
openInputStream() as FileInputStream:
Opens a binary input stream on this file.
public openOutputStream
openOutputStream() as FileOutputStream:
Opens a binary output stream on this file.
public openReader
openReader() as FileReader:
Opens a text reader on this file.
public openWriter
openWriter() as FileWriter:
Opens a text writer on this file and truncates existing content.
public read
read() as String:
Convenience helper reading and closing a text reader.
public native touch
touch() as Void throws IOException
Creates the file if it does not exist, or updates its last modification time.
public write
write(content as String):
Convenience helper writing and closing a text writer.
Methods inherited from Path: absolute, delete, endsWith, extension, file, folder, get, lastModified, name, normalize, parent, relativize, remove, rename, resolve, resolve, resolve, resolve, startsWith, toAbsolute, toString
Operators inherited from Path: operator!=(left as Path, right as Path) as Boolean:, operator==(left as Path, right as Path) as Boolean: