1515 */
1616namespace Aspose . OMR . Client
1717{
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 ;
2518 using System ;
2619 using System . Collections . Generic ;
2720 using System . IO ;
@@ -30,6 +23,11 @@ namespace Aspose.OMR.Client
3023 using TemplateModel ;
3124 using Utility ;
3225 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 ;
3331
3432 /// <summary>
3533 /// Provides API to communicate with Omr Core
@@ -39,7 +37,7 @@ public static class CoreApi
3937 /// <summary>
4038 /// The base path to call REST API
4139 /// </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 " ;
4341
4442 /// <summary>
4543 /// The app key
@@ -195,7 +193,7 @@ public static ImageRecognitionResult RecognizeImage(string imageName, byte[] ima
195193
196194 ImageRecognitionResult recognitionResult = new ImageRecognitionResult ( ) ;
197195
198- foreach ( Omr . Cloud . Sdk . Model . FileInfo file in responseResult . ResponseFiles )
196+ foreach ( FileInfo file in responseResult . ResponseFiles )
199197 {
200198 if ( file . Name . Contains ( ".dat" ) )
201199 {
@@ -245,11 +243,11 @@ public static OmrResponse RunOmrTask(OmrFunctions action, string fileName, byte[
245243 storageConfiguration . AppKey = AppKey ;
246244 storageConfiguration . AppSid = AppSid ;
247245 storageConfiguration . ApiBaseUrl = baseHost ;
248- StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
246+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
249247
250248 using ( Stream stream = new MemoryStream ( fileData ) )
251249 {
252- storageApi . PutCreate ( new PutCreateRequest ( fileName , stream ) ) ;
250+ fileApi . UploadFile ( new UploadFileRequest ( fileName , stream ) ) ;
253251 }
254252 }
255253 catch ( ApiException e )
@@ -309,15 +307,16 @@ public static void StorageCleanUp(List<string> files)
309307 storageConfiguration . AppSid = AppSid ;
310308 storageConfiguration . ApiBaseUrl = baseHost ;
311309 StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
310+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
312311
313312 foreach ( string file in files )
314313 {
315314 BusyIndicatorManager . UpdateText ( "Storage clean up...\n Deleting file: " + file ) ;
316315
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 )
319318 {
320- RemoveFileResponse deleteResponse = storageApi . DeleteFile ( new DeleteFileRequest ( file ) ) ;
319+ fileApi . DeleteFile ( new DeleteFileRequest ( file ) ) ;
321320 }
322321 }
323322 }
@@ -344,11 +343,11 @@ public static void StorageUploadImages(Dictionary<string, byte[]> imagesToUpload
344343 storageConfiguration . AppKey = AppKey ;
345344 storageConfiguration . AppSid = AppSid ;
346345 storageConfiguration . ApiBaseUrl = baseHost ;
347- StorageApi storageApi = new StorageApi ( storageConfiguration ) ;
346+ FileApi fileApi = new FileApi ( storageConfiguration ) ;
348347
349348 using ( Stream stream = new MemoryStream ( item . Value ) )
350349 {
351- storageApi . PutCreate ( new PutCreateRequest ( item . Key , stream ) ) ;
350+ fileApi . UploadFile ( new UploadFileRequest ( item . Key , stream ) ) ;
352351 }
353352 }
354353 }
0 commit comments