2015-11-04 05:47:05 -05:00
|
|
|
var regionExtractor = require('../regionExtractor');
|
2015-10-23 15:47:20 -04:00
|
|
|
var buildRegionDocs = regionExtractor.buildRegionDocs;
|
|
|
|
|
2015-08-03 20:45:58 -04:00
|
|
|
/**
|
2015-11-04 05:47:05 -05:00
|
|
|
* @dgService
|
2015-08-03 20:45:58 -04:00
|
|
|
* @description
|
|
|
|
*/
|
2015-11-04 05:47:05 -05:00
|
|
|
module.exports = function regionFileReader(log ) {
|
2015-08-03 20:45:58 -04:00
|
|
|
return {
|
2015-11-04 05:47:05 -05:00
|
|
|
name: 'regionFileReader',
|
2015-08-03 20:45:58 -04:00
|
|
|
|
|
|
|
getDocs: function (fileInfo) {
|
2015-09-18 22:51:10 -04:00
|
|
|
// log.info("fileShredder processing: " + fileInfo.relativePath);
|
2015-10-23 15:47:20 -04:00
|
|
|
var docs = buildRegionDocs(fileInfo.content, fileInfo.extension);
|
|
|
|
var wasShredded = docs.some(function(doc) {
|
|
|
|
return doc.regionName != null;
|
|
|
|
});
|
|
|
|
if (wasShredded) {
|
2015-09-18 22:51:10 -04:00
|
|
|
log.info("shredded file: " + fileInfo.relativePath);
|
|
|
|
}
|
|
|
|
return docs;
|
2015-08-03 20:45:58 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|