-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.js
More file actions
28 lines (23 loc) · 863 Bytes
/
Utils.js
File metadata and controls
28 lines (23 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
class Utils {
static async UploadTestFile(filePath)
{
let resourcesFolder = './Resources/';
let existResponse = await storageApi.objectExists(new editor_cloud.ObjectExistsRequest(filePath, myStorage));
if (existResponse.exists === false) {
var file = fs.readFileSync(resourcesFolder + filePath);
var uploadRequest = new editor_cloud.UploadFileRequest(filePath, file);
await fileApi.uploadFile(uploadRequest);
console.log("Uploaded: " + filePath);
}
}
static async UploadTestFiles()
{
await this.UploadTestFile("WordProcessing/password-protected.docx");
await this.UploadTestFile("Spreadsheet/four-sheets.xlsx");
await this.UploadTestFile("Spreadsheet/sample.tsv");
await this.UploadTestFile("Text/document.txt");
await this.UploadTestFile("Presentation/with-notes.pptx");
}
}
module.exports = Utils;