Skip to content

Commit 270937a

Browse files
author
evgeny.ivanov
committed
SDK regenerated by CI server [ci skip]
1 parent 749efe2 commit 270937a

40 files changed

+336
-172
lines changed

examples/AcceptAllRevisions.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
import java.nio.file.Files;
77
import java.nio.file.Paths;
88

9-
String documentsDir = "...";
109
ApiClient apiClient = new ApiClient(/*clientId*/ "####-####-####-####-####", /*clientSecret*/ "##################", null);
1110
WordsApi wordsApi = new WordsApi(apiClient);
1211
String fileName = "test_doc.docx";
1312

1413
// Upload original document to cloud storage.
15-
UploadFileRequest uploadFileRequestRequest = new UploadFileRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),fileName,null);
16-
wordsApi.uploadFile(uploadFileRequestRequest);
14+
byte[] myVar1 = Files.readAllBytes(Paths.get(fileName).toAbsolutePath());
15+
String myVar2 = fileName;
16+
UploadFileRequest uploadFileRequest = new UploadFileRequest(myVar1, myVar2, null);
17+
wordsApi.uploadFile(uploadFileRequest);
1718

1819
// Calls AcceptAllRevisions method for document in cloud.
19-
AcceptAllRevisionsRequest requestRequest = new AcceptAllRevisionsRequest(fileName,null,null,null,null,null);
20-
wordsApi.acceptAllRevisions(requestRequest);
20+
String myVar3 = fileName;
21+
AcceptAllRevisionsRequest request = new AcceptAllRevisionsRequest(myVar3, null, null, null, null, null);
22+
wordsApi.acceptAllRevisions(request);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
String documentsDir = "...";
21
ApiClient apiClient = new ApiClient(/*clientId*/ "####-####-####-####-####", /*clientSecret*/ "##################", null);
32
WordsApi wordsApi = new WordsApi(apiClient);
43
String fileName = "test_doc.docx";
54

65
// Calls AcceptAllRevisionsOnline method for document in cloud.
7-
AcceptAllRevisionsOnlineRequest requestRequest = new AcceptAllRevisionsOnlineRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),null,null,null);
8-
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(requestRequest);
6+
byte[] requestDocument = Files.readAllBytes(Paths.get(fileName).toAbsolutePath());
7+
AcceptAllRevisionsOnlineRequest request = new AcceptAllRevisionsOnlineRequest(requestDocument, null, null, null);
8+
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(request);
99
Files.write(Paths.get("test_result.docx"), acceptAllRevisionsOnlineResult.getDocument());

src/test/java/com/aspose/words/cloud/TestExamples.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ public void testAcceptAllRevisions() throws Exception
6161
String fileName = "test_doc.docx";
6262

6363
// Upload original document to cloud storage.
64-
UploadFileRequest uploadFileRequestRequest = new UploadFileRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),fileName,null);
65-
wordsApi.uploadFile(uploadFileRequestRequest);
64+
byte[] myVar1 = Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath());
65+
String myVar2 = fileName;
66+
UploadFileRequest uploadFileRequest = new UploadFileRequest(myVar1, myVar2, null);
67+
wordsApi.uploadFile(uploadFileRequest);
6668

6769
// Calls AcceptAllRevisions method for document in cloud.
68-
AcceptAllRevisionsRequest requestRequest = new AcceptAllRevisionsRequest(fileName,null,null,null,null,null);
69-
wordsApi.acceptAllRevisions(requestRequest);
70+
String myVar3 = fileName;
71+
AcceptAllRevisionsRequest request = new AcceptAllRevisionsRequest(myVar3, null, null, null, null, null);
72+
wordsApi.acceptAllRevisions(request);
7073
}
7174

7275
@Test
@@ -77,8 +80,9 @@ public void testAcceptAllRevisionsOnline() throws Exception
7780
String fileName = "test_doc.docx";
7881

7982
// Calls AcceptAllRevisionsOnline method for document in cloud.
80-
AcceptAllRevisionsOnlineRequest requestRequest = new AcceptAllRevisionsOnlineRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),null,null,null);
81-
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(requestRequest);
83+
byte[] requestDocument = Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath());
84+
AcceptAllRevisionsOnlineRequest request = new AcceptAllRevisionsOnlineRequest(requestDocument, null, null, null);
85+
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(request);
8286
Files.write(Paths.get("test_result.docx"), acceptAllRevisionsOnlineResult.getDocument());
8387
}
8488
}

src/test/java/com/aspose/words/cloud/api/bookmark/TestBookmark.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ public void testGetBookmarks() throws ApiException, MessagingException, IOExcept
8787
@Test
8888
public void testGetBookmarksOnline() throws ApiException, MessagingException, IOException
8989
{
90+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
9091
GetBookmarksOnlineRequest request = new GetBookmarksOnlineRequest(
91-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
92+
requestDocument,
9293
null,
9394
null
9495
);
@@ -129,8 +130,9 @@ public void testGetBookmarkByName() throws ApiException, MessagingException, IOE
129130
@Test
130131
public void testGetBookmarkByNameOnline() throws ApiException, MessagingException, IOException
131132
{
133+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
132134
GetBookmarkByNameOnlineRequest request = new GetBookmarkByNameOnlineRequest(
133-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
135+
requestDocument,
134136
bookmarkName,
135137
null,
136138
null
@@ -183,12 +185,13 @@ public void testUpdateBookmarkOnline() throws ApiException, MessagingException,
183185
{
184186
String remoteFileName = "TestUpdateDocumentBookmark.docx";
185187

188+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
186189
BookmarkData requestBookmarkData = new BookmarkData();
187190
requestBookmarkData.setName(bookmarkName);
188191
requestBookmarkData.setText("This will be the text for Aspose");
189192

190193
UpdateBookmarkOnlineRequest request = new UpdateBookmarkOnlineRequest(
191-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
194+
requestDocument,
192195
bookmarkName,
193196
requestBookmarkData,
194197
null,

src/test/java/com/aspose/words/cloud/api/compatibility/TestCompatibility.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ public void testOptimizeDocument() throws ApiException, MessagingException, IOEx
9292
@Test
9393
public void testOptimizeDocumentOnline() throws ApiException, MessagingException, IOException
9494
{
95+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
9596
OptimizationOptions requestOptions = new OptimizationOptions();
9697
requestOptions.setMsWordVersion(OptimizationOptions.MsWordVersionEnum.WORD2002);
9798

9899
OptimizeDocumentOnlineRequest request = new OptimizeDocumentOnlineRequest(
99-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
100+
requestDocument,
100101
requestOptions,
101102
null,
102103
null,

src/test/java/com/aspose/words/cloud/api/document/TestAppendDocument.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public void testAppendDocumentOnline() throws ApiException, MessagingException,
109109
remoteDataFolder + "/" + remoteFileName
110110
);
111111

112+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
112113
DocumentEntry requestDocumentListDocumentEntries0 = new DocumentEntry();
113114
requestDocumentListDocumentEntries0.setHref(remoteDataFolder + "/" + remoteFileName);
114115
requestDocumentListDocumentEntries0.setImportFormatMode("KeepSourceFormatting");
@@ -120,7 +121,7 @@ public void testAppendDocumentOnline() throws ApiException, MessagingException,
120121
requestDocumentList.setDocumentEntries(requestDocumentListDocumentEntries);
121122

122123
AppendDocumentOnlineRequest request = new AppendDocumentOnlineRequest(
123-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
124+
requestDocument,
124125
requestDocumentList,
125126
null,
126127
null,

src/test/java/com/aspose/words/cloud/api/document/TestClassification.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ public void testClassifyDocument() throws ApiException, MessagingException, IOEx
109109
@Test
110110
public void testClassifyDocumentOnline() throws ApiException, MessagingException, IOException
111111
{
112+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
112113
ClassifyDocumentOnlineRequest request = new ClassifyDocumentOnlineRequest(
113-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
114+
requestDocument,
114115
null,
115116
null,
116117
"3",

src/test/java/com/aspose/words/cloud/api/document/TestComment.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ public void testGetComment() throws ApiException, MessagingException, IOExceptio
8989
@Test
9090
public void testGetCommentOnline() throws ApiException, MessagingException, IOException
9191
{
92+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
9293
GetCommentOnlineRequest request = new GetCommentOnlineRequest(
93-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
94+
requestDocument,
9495
0,
9596
null,
9697
null
@@ -135,8 +136,9 @@ public void testGetComments() throws ApiException, MessagingException, IOExcepti
135136
@Test
136137
public void testGetCommentsOnline() throws ApiException, MessagingException, IOException
137138
{
139+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
138140
GetCommentsOnlineRequest request = new GetCommentsOnlineRequest(
139-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
141+
requestDocument,
140142
null,
141143
null
142144
);
@@ -206,6 +208,7 @@ public void testInsertComment() throws ApiException, MessagingException, IOExcep
206208
@Test
207209
public void testInsertCommentOnline() throws ApiException, MessagingException, IOException
208210
{
211+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
209212
NodeLink requestCommentRangeStartNode = new NodeLink();
210213
requestCommentRangeStartNode.setNodeId("0.3.0.3");
211214

@@ -228,7 +231,7 @@ public void testInsertCommentOnline() throws ApiException, MessagingException, I
228231
requestComment.setText("A new Comment");
229232

230233
InsertCommentOnlineRequest request = new InsertCommentOnlineRequest(
231-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
234+
requestDocument,
232235
requestComment,
233236
null,
234237
null,
@@ -303,6 +306,7 @@ public void testUpdateComment() throws ApiException, MessagingException, IOExcep
303306
@Test
304307
public void testUpdateCommentOnline() throws ApiException, MessagingException, IOException
305308
{
309+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
306310
NodeLink requestCommentRangeStartNode = new NodeLink();
307311
requestCommentRangeStartNode.setNodeId("0.3.0");
308312

@@ -325,7 +329,7 @@ public void testUpdateCommentOnline() throws ApiException, MessagingException, I
325329
requestComment.setText("A new Comment");
326330

327331
UpdateCommentOnlineRequest request = new UpdateCommentOnlineRequest(
328-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
332+
requestDocument,
329333
0,
330334
requestComment,
331335
null,
@@ -373,8 +377,9 @@ public void testDeleteComment() throws ApiException, MessagingException, IOExcep
373377
@Test
374378
public void testDeleteCommentOnline() throws ApiException, MessagingException, IOException
375379
{
380+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
376381
DeleteCommentOnlineRequest request = new DeleteCommentOnlineRequest(
377-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
382+
requestDocument,
378383
0,
379384
null,
380385
null,
@@ -420,8 +425,9 @@ public void testDeleteComments() throws ApiException, MessagingException, IOExce
420425
@Test
421426
public void testDeleteCommentsOnline() throws ApiException, MessagingException, IOException
422427
{
428+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath());
423429
DeleteCommentsOnlineRequest request = new DeleteCommentsOnlineRequest(
424-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFile).toAbsolutePath()),
430+
requestDocument,
425431
null,
426432
null,
427433
null,

src/test/java/com/aspose/words/cloud/api/document/TestCompareDocument.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ public void testCompareDocumentOnline() throws ApiException, MessagingException,
111111
remoteFolder + "/" + remoteName2
112112
);
113113

114+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName1).toAbsolutePath());
114115
CompareData requestCompareData = new CompareData();
115116
requestCompareData.setAuthor("author");
116117
requestCompareData.setComparingWithDocument(remoteFolder + "/" + remoteName2);
117118
requestCompareData.setDateTime(OffsetDateTime.of(2015, 10, 26, 0, 0, 0, 0, ZoneOffset.UTC));
118119

119120
CompareDocumentOnlineRequest request = new CompareDocumentOnlineRequest(
120-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName1).toAbsolutePath()),
121+
requestDocument,
121122
requestCompareData,
122123
null,
123124
null,
@@ -144,15 +145,17 @@ public void testCompareTwoDocumentOnline() throws ApiException, MessagingExcepti
144145
remoteFolder + "/" + remoteName2
145146
);
146147

148+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName1).toAbsolutePath());
147149
CompareData requestCompareData = new CompareData();
148150
requestCompareData.setAuthor("author");
149151
requestCompareData.setComparingWithDocument(remoteFolder + "/" + remoteName2);
150152
requestCompareData.setDateTime(OffsetDateTime.of(2015, 10, 26, 0, 0, 0, 0, ZoneOffset.UTC));
151153

154+
byte[] requestComparingDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName2).toAbsolutePath());
152155
CompareDocumentOnlineRequest request = new CompareDocumentOnlineRequest(
153-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName1).toAbsolutePath()),
156+
requestDocument,
154157
requestCompareData,
155-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName2).toAbsolutePath()),
158+
requestComparingDocument,
156159
null,
157160
null,
158161
TestInitializer.RemoteTestOut + "/TestCompareDocumentOut.doc"

src/test/java/com/aspose/words/cloud/api/document/TestConvertDocument.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ public void testSaveAsOnline() throws ApiException, MessagingException, IOExcept
9797
{
9898
String localName = "test_multi_pages.docx";
9999

100+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, "Common/" + localName).toAbsolutePath());
100101
SaveOptionsData requestSaveOptionsData = new SaveOptionsData();
101102
requestSaveOptionsData.setSaveFormat("pdf");
102103
requestSaveOptionsData.setFileName(TestInitializer.RemoteTestOut + "/TestSaveAs.pdf");
103104

104105
SaveAsOnlineRequest request = new SaveAsOnlineRequest(
105-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, "Common/" + localName).toAbsolutePath()),
106+
requestDocument,
106107
requestSaveOptionsData,
107108
null,
108109
null,
@@ -206,12 +207,13 @@ public void testSaveAsTiffOnline() throws ApiException, MessagingException, IOEx
206207
{
207208
String localName = "test_multi_pages.docx";
208209

210+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, "Common/" + localName).toAbsolutePath());
209211
TiffSaveOptionsData requestSaveOptions = new TiffSaveOptionsData();
210212
requestSaveOptions.setSaveFormat("tiff");
211213
requestSaveOptions.setFileName(TestInitializer.RemoteTestOut + "/abc.tiff");
212214

213215
SaveAsTiffOnlineRequest request = new SaveAsTiffOnlineRequest(
214-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, "Common/" + localName).toAbsolutePath()),
216+
requestDocument,
215217
requestSaveOptions,
216218
null,
217219
null,
@@ -245,8 +247,9 @@ public void testSaveAsTiffOnline() throws ApiException, MessagingException, IOEx
245247
@Test
246248
public void testConvertDocument() throws ApiException, MessagingException, IOException
247249
{
250+
byte[] requestDocument = Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/test_uploadfile.docx").toAbsolutePath());
248251
ConvertDocumentRequest request = new ConvertDocumentRequest(
249-
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/test_uploadfile.docx").toAbsolutePath()),
252+
requestDocument,
250253
"pdf",
251254
null,
252255
null,

0 commit comments

Comments
 (0)