io-functions

A collection of functional interfaces for I/O operations

License

License

GroupId

GroupId

com.github.robtimus
ArtifactId

ArtifactId

io-functions
Last Version

Last Version

2.0
Release Date

Release Date

Type

Type

jar
Description

Description

io-functions
A collection of functional interfaces for I/O operations
Project URL

Project URL

https://robtimus.github.io/io-functions/
Source Code Management

Source Code Management

https://github.com/robtimus/io-functions

Download io-functions

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.robtimus/io-functions/ -->
<dependency>
    <groupId>com.github.robtimus</groupId>
    <artifactId>io-functions</artifactId>
    <version>2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.robtimus/io-functions/
implementation 'com.github.robtimus:io-functions:2.0'
// https://jarcasting.com/artifacts/com.github.robtimus/io-functions/
implementation ("com.github.robtimus:io-functions:2.0")
'com.github.robtimus:io-functions:jar:2.0'
<dependency org="com.github.robtimus" name="io-functions" rev="2.0">
  <artifact name="io-functions" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.robtimus', module='io-functions', version='2.0')
)
libraryDependencies += "com.github.robtimus" % "io-functions" % "2.0"
[com.github.robtimus/io-functions "2.0"]

Dependencies

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.7.0

Project Modules

There are no modules declared in this project.

io-functions

The io-functions library provides functional interfaces for I/O operations. These are basically copies of the functional interfaces in java.util.functions except their methods can throw IOExceptions.

Each of these interfaces also contains static methods unchecked and checked to convert them into their matching JSE equivalents. For example, to delete all files in a directory that match a filter, you can use IOConsumer.unchecked:

try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, filter)) {
    stream.forEach(unchecked(Files::delete));
} catch (UncheckedIOException e) {
    throw e.getCause();
}

Versions

Version
2.0
1.1
1.0