|
NIO2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of file referencepublic interface FileAction<T extends FileRef>
An interface that is implemented by objects that operate on a file. An
implementation of this interface is provided to the withDirectory
utility method so that the file action is invoked
for all accepted entries in the directory, after which, the directory
is automatically closed.
Usage Example: Suppose we require to perform a task on all class files in a directory:
Path dir = ... Files.withDirectory(dir, "*.class", new FileAction<Path>() { public void invoke(Path entry) { : } });
Method Summary | |
---|---|
void |
invoke(T file)
Invoked for a file. |
Method Detail |
---|
void invoke(T file) throws java.io.IOException
file
- The file
java.io.IOException
- If the block terminates due an uncaught I/O exception
|
NIO2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2010 Sun Microsystems, Inc. All rights reserved. Use is subject to the terms of the GNU General Public License.