MCPcopy Create free account
hub / github.com/ShareDropio/sharedrop / File

Function File

app/services/file.js:3–30  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1import { Promise } from 'rsvp';
2
3const 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
32File.removeAll = function () {
33 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected