public class Files
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POISON_LINE
reading a file line by line should be done with two concurrent processes
- one reading the file and doing IO operations
- one processing the result
This method makes is easy to create concurrent file readers by providing
a process that fills a blocking queue with lines from a file.
|
Constructor and Description |
---|
Files() |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.BlockingQueue<java.lang.String> |
concurentLineReader(java.io.File f) |
static void |
copy(java.io.File from,
java.io.File to)
copy a file or a complete directory
|
static java.io.InputStream |
read(java.io.File f)
open text files for reading.
|
public static final java.lang.String POISON_LINE
public static java.io.InputStream read(java.io.File f) throws java.io.IOException
f
- java.io.IOException
public static java.util.concurrent.BlockingQueue<java.lang.String> concurentLineReader(java.io.File f) throws java.io.IOException
java.io.IOException
public static void copy(java.io.File from, java.io.File to) throws java.io.IOException
from
- the source file or directoryto
- the destination file or directoryjava.io.IOException