if ( scraper.getLogger().isInfoEnabled() ) {
scraper.getLogger().info("Binary file read processor: " + data.length + " bytes read.");
}
return new NodeVariable(data);
} catch (IOException e) {
throw new FileException("Error reading file: " + fullPath, e);
}
} else {
try {
String content = CommonUtil.readStringFromFile(new File(fullPath), charset);
if ( scraper.getLogger().isInfoEnabled() ) {
scraper.getLogger().info( "Text file read processor: " + (content == null ? 0 : content.length()) + " characters read." );
}
return new NodeVariable(content);
} catch (IOException e) {
throw new FileException("Error reading the file: " + fullPath, e);
}
}
}