Package one.microstream.io
Class XIO.unchecked
- java.lang.Object
-
- one.microstream.io.XIO.unchecked
-
-
Constructor Summary
Constructors Constructor Description unchecked()
-
Method Summary
Modifier and Type Method Description static <C extends Closeable>
Cclose(C closable, Throwable suppressed)
static boolean
delete(Path path)
static <P extends Path>
PensureDirectory(P directory)
static <P extends Path>
PensureDirectoryAndFile(P file)
static <P extends Path>
PensureFile(P file)
static <P extends Path>
PensureWriteableFile(P file)
static boolean
exists(Path path)
static boolean
hasNoFiles(Path directory)
static boolean
isDirectory(Path path)
static <C extends Consumer<? super Path>>
CiterateEntries(Path directory, C logic)
Warning: this (because of using Files.newDirectoryStream) does some weird file opening/locking stuff.static <C extends Consumer<? super Path>>
CiterateEntries(Path directory, C logic, Predicate<? super Path> selector)
Warning: this (because of using Files.newDirectoryStream) does some weird file opening/locking stuff.static long
lastModified(Path file)
static Path[]
listEntries(Path directory)
static <C extends XAddingCollection<? super Path>>
ClistEntries(Path directory, C target)
static <C extends XAddingCollection<? super Path>>
ClistEntries(Path directory, C target, Predicate<? super Path> selector)
static Path[]
listEntries(Path directory, Predicate<? super Path> selector)
static void
move(Path sourceFile, Path targetFile)
static long
size(FileChannel fileChannel)
static long
size(Path file)
-
-
-
Method Detail
-
close
public static final <C extends Closeable> C close(C closable, Throwable suppressed) throws IORuntimeException
- Throws:
IORuntimeException
-
close
public static final <C extends AutoCloseable> C close(C closable, Throwable suppressed) throws RuntimeException
- Throws:
RuntimeException
-
size
public static final long size(FileChannel fileChannel) throws IORuntimeException
- Throws:
IORuntimeException
-
isDirectory
public static boolean isDirectory(Path path) throws IORuntimeException
- Throws:
IORuntimeException
-
exists
public static final boolean exists(Path path) throws IORuntimeException
- Throws:
IORuntimeException
-
delete
public static final boolean delete(Path path) throws IORuntimeException
- Throws:
IORuntimeException
-
listEntries
public static final Path[] listEntries(Path directory) throws IORuntimeException
- Throws:
IORuntimeException
-
listEntries
public static Path[] listEntries(Path directory, Predicate<? super Path> selector) throws IORuntimeException
- Throws:
IORuntimeException
-
listEntries
public static final <C extends XAddingCollection<? super Path>> C listEntries(Path directory, C target) throws IORuntimeException
- Throws:
IORuntimeException
-
listEntries
public static final <C extends XAddingCollection<? super Path>> C listEntries(Path directory, C target, Predicate<? super Path> selector) throws IORuntimeException
- Throws:
IORuntimeException
-
iterateEntries
public static <C extends Consumer<? super Path>> C iterateEntries(Path directory, C logic) throws IORuntimeException
Warning: this (because of using Files.newDirectoryStream) does some weird file opening/locking stuff.Also see: https://stackoverflow.com/questions/48311252/a-bit-strange-behaviour-of-files-delete-and-files-deleteifexists
- Type Parameters:
C
-- Parameters:
directory
-logic
-- Returns:
- Throws:
IORuntimeException
-
iterateEntries
public static <C extends Consumer<? super Path>> C iterateEntries(Path directory, C logic, Predicate<? super Path> selector) throws IORuntimeException
Warning: this (because of using Files.newDirectoryStream) does some weird file opening/locking stuff.Also see: https://stackoverflow.com/questions/48311252/a-bit-strange-behaviour-of-files-delete-and-files-deleteifexists
- Type Parameters:
C
-- Parameters:
directory
-logic
-selector
-- Returns:
- Throws:
IORuntimeException
-
hasNoFiles
public static final boolean hasNoFiles(Path directory) throws IORuntimeException
- Throws:
IORuntimeException
-
size
public static final long size(Path file) throws IORuntimeException
- Throws:
IORuntimeException
-
lastModified
public static final long lastModified(Path file) throws IORuntimeException
- Throws:
IORuntimeException
-
ensureDirectory
public static final <P extends Path> P ensureDirectory(P directory) throws IORuntimeException
- Throws:
IORuntimeException
-
ensureDirectoryAndFile
public static final <P extends Path> P ensureDirectoryAndFile(P file) throws IORuntimeException
- Throws:
IORuntimeException
-
ensureFile
public static final <P extends Path> P ensureFile(P file) throws IORuntimeException
- Throws:
IORuntimeException
-
ensureWriteableFile
public static final <P extends Path> P ensureWriteableFile(P file) throws IORuntimeException
- Throws:
IORuntimeException
-
move
public static void move(Path sourceFile, Path targetFile) throws IORuntimeException, RuntimeException
- Throws:
IORuntimeException
RuntimeException
-
-