(options)
| 1 | import { Promise } from 'rsvp'; |
| 2 | |
| 3 | const File = function (options) { |
| 4 | const self = this; |
| 5 | |
| 6 | this.name = options.name; |
| 7 | this.localName = `${new Date().getTime()}-${this.name}`; |
| 8 | this.size = options.size; |
| 9 | this.type = options.type; |
| 10 | |
| 11 | this._reset(); |
| 12 | |
| 13 | return new Promise((resolve, reject) => { |
| 14 | const requestFileSystem = |
| 15 | window.requestFileSystem || window.webkitRequestFileSystem; |
| 16 | |
| 17 | requestFileSystem( |
| 18 | window.TEMPORARY, |
| 19 | options.size, |
| 20 | (filesystem) => { |
| 21 | self.filesystem = filesystem; |
| 22 | resolve(self); |
| 23 | }, |
| 24 | (error) => { |
| 25 | self.errorHandler(error); |
| 26 | reject(error); |
| 27 | }, |
| 28 | ); |
| 29 | }); |
| 30 | }; |
| 31 | |
| 32 | File.removeAll = function () { |
| 33 | return new Promise((resolve, reject) => { |
nothing calls this directly
no outgoing calls
no test coverage detected