Package com.io7m.jwheatsheaf.ui.internal
Class JWFileItems
java.lang.Object
com.io7m.jwheatsheaf.ui.internal.JWFileItems
public final class JWFileItems
extends java.lang.Object
Functions over file items.
-
Method Summary
Modifier and Type Method Description static java.util.List<JWFileItem>
listDirectory(java.nio.file.Path directory, boolean withParent)
List the given directory, resolving each entry into a file item.static JWFileItem
resolveFileItem(java.nio.file.Path path)
Resolve the given path into a file item.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
listDirectory
public static java.util.List<JWFileItem> listDirectory(java.nio.file.Path directory, boolean withParent) throws java.io.IOExceptionList the given directory, resolving each entry into a file item.- Parameters:
directory
- The directorywithParent
-true
if the parent directory entry should be included- Returns:
- A list of items
- Throws:
java.io.IOException
- On I/O errors
-
resolveFileItem
Resolve the given path into a file item. If the file item cannot be resolved due to permissions errors or other I/O errors, a file item is returned with identity values in each field (such as 0 for the file size).- Parameters:
path
- The input path- Returns:
- A file item
-