2018-02-26 21:25:54 +02:00
|
|
|
class InteropService_Exporter_Base {
|
|
|
|
|
|
|
|
async init(destDir) {}
|
|
|
|
async processItem(ItemClass, item) {}
|
|
|
|
async processResource(resource, filePath) {}
|
|
|
|
async close() {}
|
|
|
|
|
2018-06-26 01:07:53 +02:00
|
|
|
setMetadata(md) {
|
|
|
|
this.metadata_ = md;
|
|
|
|
}
|
|
|
|
|
|
|
|
metadata() {
|
|
|
|
return this.metadata_;
|
|
|
|
}
|
|
|
|
|
2018-11-21 02:36:23 +02:00
|
|
|
updateContext(context) {
|
|
|
|
this.context_ = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
context() {
|
|
|
|
return this.context_;
|
|
|
|
}
|
|
|
|
|
2018-02-26 21:25:54 +02:00
|
|
|
async temporaryDirectory_(createIt) {
|
|
|
|
const md5 = require('md5');
|
|
|
|
const tempDir = require('os').tmpdir() + '/' + md5(Math.random() + Date.now());
|
|
|
|
if (createIt) await require('fs-extra').mkdirp(tempDir);
|
|
|
|
return tempDir;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = InteropService_Exporter_Base;
|