-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUtils.js
More file actions
29 lines (24 loc) · 946 Bytes
/
Utils.js
File metadata and controls
29 lines (24 loc) · 946 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
29
"use strict";
class Utils {
static async UploadTestFile(filePath)
{
let resourcesFolder = './Resources/';
let existResponse = await storageApi.objectExists(new annotation_cloud.ObjectExistsRequest(filePath, myStorage));
if (existResponse.exists === false) {
let file = fs.readFileSync(resourcesFolder + filePath);
let uploadRequest = new annotation_cloud.UploadFileRequest(filePath, file);
await fileApi.uploadFile(uploadRequest);
console.log("Uploaded: " + filePath);
}
}
static async UploadTestFiles()
{
await this.UploadTestFile("annotationdocs/input.docx");
await this.UploadTestFile("annotationdocs/one-page.docx");
await this.UploadTestFile("annotationdocs/one-page-password.docx");
await this.UploadTestFile("annotationdocs/ten-pages.docx");
await this.UploadTestFile("annotationdocs/ten-pages.pdf");
await this.UploadTestFile("annotationdocs/JohnSmith.png");
}
}
module.exports = Utils;