BATCH-1462: ignore directories if reader has strict=false
This commit is contained in:
@@ -260,6 +260,15 @@ public class FlatFileItemReader<T> extends AbstractItemCountingItemStreamItemRea
|
||||
return;
|
||||
}
|
||||
|
||||
if (!resource.isReadable()) {
|
||||
if (strict) {
|
||||
throw new IllegalStateException("Input resource must be readable (reader is in 'strict' mode): " + resource);
|
||||
}
|
||||
noInput = true;
|
||||
logger.warn("Input resource is not readable " + resource.getDescription());
|
||||
return;
|
||||
}
|
||||
|
||||
reader = bufferedReaderFactory.create(resource, encoding);
|
||||
for (int i = 0; i < linesToSkip; i++) {
|
||||
String line = readLine();
|
||||
|
||||
@@ -182,6 +182,14 @@ public class StaxEventItemReader<T> extends AbstractItemCountingItemStreamItemRe
|
||||
logger.warn("Input resource does not exist " + resource.getDescription());
|
||||
return;
|
||||
}
|
||||
if (!resource.isReadable()) {
|
||||
if (strict) {
|
||||
throw new IllegalStateException("Input resource must be readable (reader is in 'strict' mode)");
|
||||
}
|
||||
noInput = true;
|
||||
logger.warn("Input resource is not readable " + resource.getDescription());
|
||||
return;
|
||||
}
|
||||
|
||||
inputStream = resource.getInputStream();
|
||||
eventReader = XMLInputFactory.newInstance().createXMLEventReader(inputStream);
|
||||
|
||||
Reference in New Issue
Block a user