15
15
*/
16
16
namespace Aspose . OMR . Client
17
17
{
18
- using Omr . Cloud . Sdk ;
19
- using Omr . Cloud . Sdk . Model ;
20
- using Omr . Cloud . Sdk . Model . Requests ;
21
- using Storage . Cloud . Sdk ;
22
- using Storage . Cloud . Sdk . Api ;
23
- using Storage . Cloud . Sdk . Model ;
24
- using Storage . Cloud . Sdk . Model . Requests ;
25
18
using System ;
26
19
using System . Collections . Generic ;
27
20
using System . IO ;
@@ -30,6 +23,11 @@ namespace Aspose.OMR.Client
30
23
using TemplateModel ;
31
24
using Utility ;
32
25
using ViewModels ;
26
+ using FileInfo = Com . Aspose . Omr . Model . FileInfo ;
27
+
28
+ using Com . Aspose . Omr . Api ;
29
+ using Com . Aspose . Omr . Model ;
30
+ using Com . Aspose . Omr . Model . Requests ;
33
31
34
32
/// <summary>
35
33
/// Provides API to communicate with Omr Core
@@ -39,7 +37,7 @@ public static class CoreApi
39
37
/// <summary>
40
38
/// The base path to call REST API
41
39
/// </summary>
42
- private static readonly string Basepath = "http ://api.aspose.cloud/v1.1 " ;
40
+ private static readonly string Basepath = "https ://api.aspose.cloud/v3.0 " ;
43
41
44
42
/// <summary>
45
43
/// The app key
@@ -195,7 +193,7 @@ public static ImageRecognitionResult RecognizeImage(string imageName, byte[] ima
195
193
196
194
ImageRecognitionResult recognitionResult = new ImageRecognitionResult ( ) ;
197
195
198
- foreach ( Omr . Cloud . Sdk . Model . FileInfo file in responseResult . ResponseFiles )
196
+ foreach ( FileInfo file in responseResult . ResponseFiles )
199
197
{
200
198
if ( file . Name . Contains ( ".dat" ) )
201
199
{
@@ -245,11 +243,11 @@ public static OmrResponse RunOmrTask(OmrFunctions action, string fileName, byte[
245
243
storageConfiguration . AppKey = AppKey ;
246
244
storageConfiguration . AppSid = AppSid ;
247
245
storageConfiguration . ApiBaseUrl = baseHost ;
248
- StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
246
+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
249
247
250
248
using ( Stream stream = new MemoryStream ( fileData ) )
251
249
{
252
- storageApi . PutCreate ( new PutCreateRequest ( fileName , stream ) ) ;
250
+ fileApi . UploadFile ( new UploadFileRequest ( fileName , stream ) ) ;
253
251
}
254
252
}
255
253
catch ( ApiException e )
@@ -309,15 +307,16 @@ public static void StorageCleanUp(List<string> files)
309
307
storageConfiguration . AppSid = AppSid ;
310
308
storageConfiguration . ApiBaseUrl = baseHost ;
311
309
StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
310
+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
312
311
313
312
foreach ( string file in files )
314
313
{
315
314
BusyIndicatorManager . UpdateText ( "Storage clean up...\n Deleting file: " + file ) ;
316
315
317
- FileExistResponse existsResponse = storageApi . GetIsExist ( new GetIsExistRequest ( file ) ) ;
318
- if ( existsResponse . FileExist . IsExist == true )
316
+ ObjectExist existsResponse = storageApi . ObjectExists ( new ObjectExistsRequest ( file ) ) ;
317
+ if ( existsResponse . Exists == false )
319
318
{
320
- RemoveFileResponse deleteResponse = storageApi . DeleteFile ( new DeleteFileRequest ( file ) ) ;
319
+ fileApi . DeleteFile ( new DeleteFileRequest ( file ) ) ;
321
320
}
322
321
}
323
322
}
@@ -344,11 +343,11 @@ public static void StorageUploadImages(Dictionary<string, byte[]> imagesToUpload
344
343
storageConfiguration . AppKey = AppKey ;
345
344
storageConfiguration . AppSid = AppSid ;
346
345
storageConfiguration . ApiBaseUrl = baseHost ;
347
- StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
346
+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
348
347
349
348
using ( Stream stream = new MemoryStream ( item . Value ) )
350
349
{
351
- storageApi . PutCreate ( new PutCreateRequest ( item . Key , stream ) ) ;
350
+ fileApi . UploadFile ( new UploadFileRequest ( item . Key , stream ) ) ;
352
351
}
353
352
}
354
353
}
0 commit comments