diff --git a/src/models/file.js b/src/models/file.js index 86600df..f2ee313 100644 --- a/src/models/file.js +++ b/src/models/file.js @@ -40,6 +40,24 @@ class File { + /** + * Download a file from a url + * @returns {Promise} filepath + */ + async fakeDownload() { + const url = URL.parse(this.url); + this.filename = slugify(url.hostname, { lower: true }); + const filepath = path.join(dest, `bodacc-datadila.opendatasoft.com-1697536785170.csv`); + const generatedpath = path.join(dest, `bodacc-datadila.opendatasoft.com-generated-1697536785170-2.csv`); + this.filepath = filepath; + this.generatedpath = generatedpath; + return new Promise((resolve, reject) => { + resolve(filepath); + }); + } + + + /** * Download a file from a url * @returns {Promise} filepath