|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.staccatocommons.io.Files
public class Files
Simple Applicatives for dealing with Files
| Constructor Summary | |
|---|---|
Files()
|
|
| Method Summary | ||
|---|---|---|
static net.sf.staccatocommons.defs.function.Function<File,String> |
fileName()
Answers a function that returns the name of a file |
|
static net.sf.staccatocommons.defs.function.Function<File,String> |
filePath()
Answers a function that returns the path of a file |
|
protected static
|
handleFileNotFound(File file,
FileNotFoundException e)
|
|
static FileChannel |
openChannel(File file)
Opens an FileChannel for the given file. |
|
static FileInputStream |
openInputStream(File file)
Opens an InputStream for the given file. |
|
static Reader |
openReader(File file)
Opens a Reader for the given file. |
|
static net.sf.staccatocommons.defs.predicate.Predicate<File> |
suffix(String... suffixes)
Answers a predicate that evaluates if a file ends with a given suffix |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Files()
| Method Detail |
|---|
@Constant public static net.sf.staccatocommons.defs.function.Function<File,String> fileName()
Function that returns arg.getName()@Constant public static net.sf.staccatocommons.defs.function.Function<File,String> filePath()
Function that returns arg.getPath()
public static net.sf.staccatocommons.defs.predicate.Predicate<File> suffix(@NonNull
String... suffixes)
suffixes -
PredicateSuffixFileFilter
public static Reader openReader(@NonNull
File file)
Reader for the given file. The file must
exist, must be readable, and must be a
regular file.
file -
Reader
public static FileInputStream openInputStream(@NonNull
File file)
InputStream for the given file. The file
must exist, must be readable, and
must be a regular file.
file -
InputStream
public static FileChannel openChannel(@NonNull
File file)
FileChannel for the given file. The file
must exist, must be readable, and
must be a regular file.
file -
openInputStream(file).getChannel()
protected static <T> T handleFileNotFound(File file,
FileNotFoundException e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||