public static interface FileProcessor.FileHandler
Modifier and Type | Method and Description |
---|---|
void |
directory(File dir)
Handle a directory.
|
void |
file(String path,
InputStream is,
File file)
Handle a file stream.
|
void directory(File dir) throws Exception
Called for all processed child (and descendant if
FileProcessor.isRecurseSubdirs()
directories of the input file,
excluding the input directory itself. NOTE: This is only called for regular
directories, and not for archives or processed directories within archives.
NOTE: FileProcessor.pattGlob
is NOT applied to directories. So the
directory names may not match the provided pattern.
This function may be called in multiple threads when FileProcessor was
created with thread support (see
FileProcessor#FileProcessor(boolean, boolean, boolean)
)
dir
- the directoryException
- these will be passed to
FileProcessor.ErrorHandler.errorOccurred(Throwable, String, File)
void file(String path, InputStream is, File file) throws Exception
Called for all processed files that match the FileProcessor.pattGlob
,
including the input file. Not called for archives if
FileProcessor.isProcessArchives()
is true (though it will then be
called for files within those archives).
This function may be called in multiple threads when FileProcessor was
created with thread support (see
FileProcessor#FileProcessor(boolean, boolean, boolean)
)
NOTE: the InputStream should be closed by the implementation.
path
- filename, including path inside archives (if the file is within
an archive)is
- file
- (optional, if known) the file from which the InputStream was
built, or - if the InputStream is a file within an archive - the
archive.Exception
- these will be passed to
FileProcessor.ErrorHandler.errorOccurred(Throwable, String, File)
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.