uk.co.mruoc.file.line.DefaultFileLineLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of file-loader Show documentation
Show all versions of file-loader Show documentation
Code library to easily load files and file from the classpath or file system file
The newest version!
package uk.co.mruoc.file.line;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Collection;
import lombok.RequiredArgsConstructor;
import uk.co.mruoc.file.BufferedReaderLoader;
import uk.co.mruoc.file.FileLoadException;
@RequiredArgsConstructor
public class DefaultFileLineLoader implements FileLineLoader {
private final BufferedReaderLoader bufferedReaderLoader;
@Override
public Collection loadLines(String path) {
try (BufferedReader reader = bufferedReaderLoader.load(path)) {
return reader.lines().toList();
} catch (IOException e) {
throw new FileLoadException(path, e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy