|
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 IOException
file
- The file
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 © 2007, 2011, Oracle and/or its affiliates. All rights reserved.