FolderPath
classin packageklyn.io
public class FolderPath extends Path
└ FolderPath

Represents a directory path.

import klyn.io

root = Path.cwd
names = root.listNames()
print(names.size)
Inherited Properties
propertyInherited Properties from Path: cwd, exists, extension, isAbsolute, isDirectory, isFile, isNormalized, isRegular, isSymlink, klynHome, lastModified, name, resourcesHome, size, tempDir, userHome
Constructors
Modifier and Type Member Description
public FolderPath
FolderPath(base as FolderPath, names... as String)
Convenience overload when the base is already a FolderPath.
public FolderPath
FolderPath(base as Path, names... as String)
Creates a directory path by resolving multiple child segments from a base path.
public FolderPath
FolderPath(filename as String)
Creates a directory path wrapper from a path string.
public FolderPath
FolderPath(path as Path)
Creates a directory path wrapper from another path instance.
Methods
Modifier and Type Member Description
public list
list() as ArrayList<Path>
Lists direct children as paths.
public listNames
listNames() as ArrayList<String>
Lists direct child names.
public mkdir
mkdir() as Void throws IOException
Creates this directory only.
public mkdirs
mkdirs() as Void throws IOException
Creates this directory and all missing parent directories.
public openReader
openReader( includeFileNames as Boolean = true, includeFileBytes as Boolean = false, followSymlinks as Boolean = false ) as DirectoryReader throws IOException
Opens a streaming cursor over this directory.
public removeAll
removeAll() as Void throws IOException
Recursively removes the folder content and the folder itself.
public toAbsoluteFolder
toAbsoluteFolder() as FolderPath throws IOException
Returns a lexically normalized absolute FolderPath without querying target metadata on disk.
Inherited Methods
methodInherited Methods from Path: absolute, delete, endsWith, file, folder, get, hash, normalize, parent, read, relativize, remove, rename, resolve, resolve, resolve, resolve, roots, searchText, searchText, startsWith, toAbsolute, toString, touch, write
Inherited Operators
operatorInherited Operators from Path: operator!=(left as Path, right as Path) as Boolean, operator==(left as Path, right as Path) as Boolean