tizen 2.4 release
[framework/convergence/service/adaptors/storage-adaptor.git] / inc / storage-adaptor.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __STORAGE_ADAPTOR_H__
18 #define __STORAGE_ADAPTOR_H__
19
20 #ifndef EXPORT_API
21 #define EXPORT_API __attribute__((visibility("default")))
22 #endif
23
24 #include <glib.h>
25 #include <stdint.h>
26 #include <sys/types.h>
27 #include <sys/stat.h>
28 #include <fcntl.h>
29 #include <stdbool.h>
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35
36 /**
37  * Storage adaptor error code
38  */
39 typedef enum storage_error_code_e
40 {
41         STORAGE_ADAPTOR_ERROR_NONE                      = 0,
42         STORAGE_ADAPTOR_ERROR_LAUNCH                    = 1,    /**< 1 ~ 99: internal error*/
43         STORAGE_ADAPTOR_ERROR_INIT                      = 2,
44         STORAGE_ADAPTOR_ERROR_DEINIT                    = 3,
45         STORAGE_ADAPTOR_ERROR_CREATE                    = 4,
46         STORAGE_ADAPTOR_ERROR_DESTROY                   = 5,
47         STORAGE_ADAPTOR_ERROR_START                     = 6,
48         STORAGE_ADAPTOR_ERROR_STOP                      = 7,
49         STORAGE_ADAPTOR_ERROR_CONNECT                   = 8,
50         STORAGE_ADAPTOR_ERROR_DISCONNECT                = 9,
51         STORAGE_ADAPTOR_ERROR_NOT_FOUND                 = 10,
52         STORAGE_ADAPTOR_ERROR_CORRUPTED                 = 11,
53         STORAGE_ADAPTOR_ERROR_UNSUPPORTED               = 12,
54         STORAGE_ADAPTOR_ERROR_INVALID_HANDLE            = 13,
55         STORAGE_ADAPTOR_ERROR_INVALID_ARGUMENT          = 14,
56         STORAGE_ADAPTOR_ERROR_INVALID_ARGUMENT_TYPE     = 15,
57         STORAGE_ADAPTOR_ERROR_NOT_AUTHORIZED            = 16,
58         STORAGE_ADAPTOR_ERROR_ADAPTOR_INTERNAL          = 17,
59         STORAGE_ADAPTOR_ERROR_PLUGIN_INTERNAL           = 18,
60         STORAGE_ADAPTOR_ERROR_SERVER_INTERNAL           = 19,
61         STORAGE_ADAPTOR_ERROR_DBUS                      = 20,
62         STORAGE_ADAPTOR_ERROR_CALLBACK_TIME_OUT         = 21,
63         STORAGE_ADAPTOR_ERROR_MAX
64 } storage_error_code_t;
65
66 /**
67  * Storage adaptor error code
68  */
69 typedef enum _storage_plugin_internal_error_code_e
70 {
71         STORAGE_PLUGIN_ERROR_HTTP_BAD_REQUEST           = 400,
72         STORAGE_PLUGIN_ERROR_HTTP_UNAUTHORIZED          = 401,
73         STORAGE_PLUGIN_ERROR_HTTP_FORBIDDEN             = 403,
74         STORAGE_PLUGIN_ERROR_HTTP_NOT_FOUND             = 404,
75         STORAGE_PLUGIN_ERROR_HTTP_METHOD_NOT_ALLOWED    = 405,
76         STORAGE_PLUGIN_ERROR_HTTP_BAD_GATEWAY           = 502,
77         STORAGE_PLUGIN_ERROR_HTTP_SERVICE_UNAVAILBLE    = 503,
78         STORAGE_PLUGIN_ERROR_HTTP_INSUFFICIENT_STORAGE  = 507,
79         STORAGE_PLUGIN_ERROR_HTTP_ETC                   = 598,
80         STORAGE_PLUGIN_ERROR_HTTP_UNKNOWN               = 599,
81
82         STORAGE_PLUGIN_ERROR_CURL_COULDNT_CONNECT       = 601,
83         STORAGE_PLUGIN_ERROR_CURL_TIMEOUT               = 602,
84         STORAGE_PLUGIN_ERROR_CURL_ETC                   = 698,
85         STORAGE_PLUGIN_ERROR_CURL_UNKNOWN               = 699,
86
87         STORAGE_PLUGIN_ERROR_FILE_OPEN_FAILED           = 701,
88         STORAGE_PLUGIN_ERROR_FILE_NOT_EXIST             = 702,
89         STORAGE_PLUGIN_ERROR_FILE_TRANSFER_CANCELED     = 703,
90         STORAGE_PLUGIN_ERROR_FILE_AREADY_EXIST          = 704, // EEXIST
91         STORAGE_PLUGIN_ERROR_FILE_ACCESS_DENIED         = 705, // EACCES
92         STORAGE_PLUGIN_ERROR_FILE_ETC                   = 798,
93         STORAGE_PLUGIN_ERROR_FILE_UNKNOWN               = 799,
94
95         STORAGE_PLUGIN_ERROR_MEMORY_ALLOCATION_FAILED   = 801,
96         STORAGE_PLUGIN_ERROR_MEMORY_ETC                 = 898,
97         STORAGE_PLUGIN_ERROR_MEMORY_UNKNOWN             = 899,
98
99         STORAGE_PLUGIN_ERROR_THREAD_CREATE_FAILED       = 901,
100         STORAGE_PLUGIN_ERROR_THREAD_STOPPED             = 902,
101         STORAGE_PLUGIN_ERROR_THREAD_ETC                 = 908,
102         STORAGE_PLUGIN_ERROR_THREAD_UNNOWN              = 909,
103         STORAGE_PLUGIN_ERROR_ETC                        = 998,
104         STORAGE_PLUGIN_ERROR_UNKNOWN                    = 999,
105 } storage_plugin_internal_error_code_e;
106
107 /**
108  * Storage adaptor status code
109  */
110 typedef enum _storage_adaptor_transfer_state_e
111 {
112         STORAGE_ADAPTOR_TRANSFER_STATE_IN_PROGRESS      = 1,
113         STORAGE_ADAPTOR_TRANSFER_STATE_FINISHED         = 2,
114         STORAGE_ADAPTOR_TRANSFER_STATE_CANCELED         = 3,    // canceled by request
115         STORAGE_ADAPTOR_TRANSFER_STATE_FAILED           = 4,    // canceled by system
116
117         STORAGE_ADAPTOR_TRANSFER_STATE_RESUME,  // not use this version yet (Next feature)
118         STORAGE_ADAPTOR_TRANSFER_STATE_PAUSED,  // not use this version yet (Next feature)
119
120         // Private feature
121         STORAGE_ADAPTOR_TRANSFER_STATUS_PROGRESS        = 1,
122         STORAGE_ADAPTOR_TRANSFER_STATUS_RESUME          = 1,
123         STORAGE_ADAPTOR_TRANSFER_STATUS_PAUSE           = 2,
124         STORAGE_ADAPTOR_TRANSFER_STATUS_CANCEL          = 3,    // canceled by request
125         STORAGE_ADAPTOR_TRANSFER_STATUS_STOPPED         = 4,    // canceled by system
126         STORAGE_ADAPTOR_TRANSFER_STATUS_FINISHED        = 5
127 } storage_adaptor_transfer_state_e;
128
129 typedef storage_adaptor_transfer_state_e storage_adaptor_transfer_status_e;
130
131 typedef enum
132 {
133         STORAGE_ADAPTOR_FILE_ACCESS_READ        = O_RDONLY,
134         STORAGE_ADAPTOR_FILE_ACCESS_WRITE       = O_WRONLY|O_CREAT|O_EXCL,
135 } storage_adaptor_file_access_mode_e;
136
137 /**
138  * Storage adaptor content type
139  */
140 typedef enum _storage_adaptor_content_type_e
141 {
142         STORAGE_ADAPTOR_CONTENT_TYPE_DEFAULT            = -1,   // initalize value
143
144         STORAGE_ADAPTOR_CONTENT_TYPE_IMGAE              = 160,
145         STORAGE_ADAPTOR_CONTENT_TYPE_VIDEO              = 161,
146         STORAGE_ADAPTOR_CONTENT_TYPE_SOUND              = 162,
147         STORAGE_ADAPTOR_CONTENT_TYPE_MUSIC              = 163,
148         STORAGE_ADAPTOR_CONTENT_TYPE_OTHER              = 164,
149         STORAGE_ADAPTOR_CONTENT_TYPE_DOCUMENT           = 165,
150         STORAGE_ADAPTOR_CONTENT_TYPE_THUMBNAIL          = 166,
151
152         STORAGE_ADAPTOR_CONTENT_TYPE_CHUNK_MASK         = 320,
153         STORAGE_ADAPTOR_CONTENT_TYPE_IMGAE_CHUNK        = 480,
154         STORAGE_ADAPTOR_CONTENT_TYPE_VIDEO_CHUNK        = 481,
155         STORAGE_ADAPTOR_CONTENT_TYPE_SOUND_CHUNK        = 482,
156         STORAGE_ADAPTOR_CONTENT_TYPE_MUSIC_CHUNK        = 483,
157         STORAGE_ADAPTOR_CONTENT_TYPE_OTHER_CHUNK        = 484,
158         STORAGE_ADAPTOR_CONTENT_TYPE_DOCUMENT_CHUNK     = 485,
159         STORAGE_ADAPTOR_CONTENT_TYPE_THUMBNAIL_CHUNK    = 486,
160
161         STORAGE_ADAPTOR_CONTENT_TYPE_FOLDER             = 1024,
162         STORAGE_ADAPTOR_CONTENT_TYPE_METADATA           = 2048,
163 } storage_adaptor_content_type_e;
164
165
166 /**
167  * Storage adaptor plugin handle
168  */
169 typedef struct storage_adaptor_plugin_s *storage_adaptor_plugin_h;
170
171 /**
172  * Storage adaptor
173  */
174 typedef struct storage_adaptor_s *storage_adaptor_h;
175
176 /**
177  * Storage adaptor plugin context structure
178  */
179 typedef struct storage_adaptor_plugin_context_s
180 {
181         // Context variables
182         int context_id;
183         storage_adaptor_plugin_h plugin_handle;
184
185         // User define (input by service-adaptor)
186         char *app_id;
187         char *app_secret;
188         char *access_token;
189         char *cid;
190         char *uid;
191         char *service_name;
192
193         // Plugin define (input by plugin)
194         char *plugin_uri;       // mandatory (package id)
195         void *plugin_data;      // optional
196 } storage_adaptor_plugin_context_t;
197 typedef struct storage_adaptor_plugin_context_s *storage_adaptor_plugin_context_h;
198
199 /**
200  * Structure for error code from server
201  */
202 typedef struct storage_adaptor_error_code_s
203 {
204         int64_t code;
205         char    *msg;
206 } storage_adaptor_error_code_t;
207 typedef struct storage_adaptor_error_code_s *storage_adaptor_error_code_h;
208
209 typedef struct _storage_adaptor_media_meta_s
210 {
211         char *mime_type;
212         char *title;
213         char *album;
214         char *artist;
215         char *genere;
216         char *recorded_date;
217         int width;
218         int height;
219         int duration;
220         char *copyright;
221         char *track_num;
222         char *description;
223         char *composer;
224         char *year;
225         int bitrate;
226         int samplerate;
227         int channel;
228         char *extra_media_meta;
229 } storage_adaptor_media_meta_s;
230
231 typedef struct _storage_adaptor_cloud_meta_s
232 {
233         char *service_name;
234         unsigned long long usage_byte;
235         unsigned long long quota_byte;
236         char *extra_cloud_meta;
237 } storage_adaptor_cloud_meta_s;
238
239 // private only!!
240 /**
241  * Structure Storage File Share token Infomation
242  */
243 typedef struct storage_adaptor_file_share_token_s
244 {
245         char *public_token;
246         char *auth_code;
247 } storage_adaptor_file_share_token_t;
248 typedef struct storage_adaptor_file_share_token_s *storage_adaptor_file_share_token_h;
249
250 /**
251  * Structure Storage File Infomation
252  */
253 typedef struct storage_adaptor_file_info_s
254 {
255         // Common
256         char    *plugin_uri;            /**< specifies plugin name generated file_info */
257         char    *object_id;             /**< specifies file object id be used in storage */
258         char    *storage_path;          /**< specifies file path in storage */
259         unsigned long long file_size;   /**< specifies file size (recomend byte)*/
260         int     file_info_index;        /**< specifies file info index (wide use; e.g : chunk upload, multi download)*/
261
262         // private only!!
263         int     revision;
264         unsigned long long timestamp;
265         char    *type;
266         int     deleted;
267         unsigned long long expired_time;
268         unsigned int download_count;
269         unsigned int max_download_count;
270         char    *tag;
271         storage_adaptor_file_share_token_h file_share_token;
272
273
274         // public defined
275         unsigned long long created_time;        /**< specifies timestamp */
276         unsigned long long modified_time;       /**< specifies timestamp */
277         storage_adaptor_content_type_e content_type;
278
279         storage_adaptor_media_meta_s *media_meta;
280         storage_adaptor_cloud_meta_s *cloud_meta;
281         char    *extra_file_info;               /**< specifies content name in metadata */
282 } storage_adaptor_file_info_t;
283 typedef struct storage_adaptor_file_info_s *storage_adaptor_file_info_h;
284
285 /**
286  * Storage adaptor plugin listener
287  */
288 typedef struct storage_adaptor_plugin_listener_s *storage_adaptor_plugin_listener_h;
289
290 /**
291  * Storage adaptor plugin handle
292  */
293 typedef struct storage_adaptor_plugin_handle_s
294 {
295         // Mandatory functions to handle plugin in adaptor
296         storage_error_code_t (*create_context)(storage_adaptor_plugin_context_h *context,
297                                                         const char *app_id,
298                                                         const char *app_secret,
299                                                         const char *access_token,
300                                                         const char *cid,
301                                                         const char *uid);
302         storage_error_code_t (*destroy_context)(storage_adaptor_plugin_context_h context);
303         storage_error_code_t (*destroy_handle)(struct storage_adaptor_plugin_handle_s *handle);
304         storage_error_code_t (*set_listener)(storage_adaptor_plugin_listener_h listener);
305         storage_error_code_t (*unset_listener)(void);
306         // Mandatory end
307
308         // Optional
309
310         storage_error_code_t (*open_file) (storage_adaptor_plugin_context_h context,            // Do Not define from plugin (TBD)
311                                                         const char *file_path,
312                                                         storage_adaptor_file_access_mode_e mode,
313                                                         int *file_descriptor,
314                                                         storage_adaptor_error_code_h *error);
315
316         storage_error_code_t (*close_file) (storage_adaptor_plugin_context_h context,           // Do Not define from plugin (TBD)
317                                                         int file_descriptor,
318                                                         storage_adaptor_error_code_h *error);
319
320         storage_error_code_t (*start_upload_task)(storage_adaptor_plugin_context_h context,
321                                                         int src_file_descriptor,                // read only opened
322                                                         const char *upload_dir_path,
323                                                         const char *file_name,
324                                                         bool need_progress,
325                                                         storage_adaptor_error_code_h *error,
326                                                         void *user_data);
327
328         storage_error_code_t (*start_download_task)(storage_adaptor_plugin_context_h context,
329                                                         const char *storage_dir_path,
330                                                         const char *file_name,
331                                                         int dst_file_descriptor,                // write only opened
332                                                         bool need_progress,
333                                                         storage_adaptor_error_code_h *error,
334                                                         void *user_data);
335
336         storage_error_code_t (*start_download_thumb_task)(storage_adaptor_plugin_context_h context,
337                                                         const char *storage_dir_path,
338                                                         const char *file_name,
339                                                         int dst_file_descriptor,                // write only opened
340                                                         int thumbnail_size,                     // level (defined plugin SPEC)
341                                                         bool need_progress,
342                                                         storage_adaptor_error_code_h *error,
343                                                         void *user_data);
344
345         storage_error_code_t (*cancel_upload_task)(storage_adaptor_plugin_context_h context,
346                                                         int file_descriptor,
347                                                         storage_adaptor_error_code_h *error);
348
349         storage_error_code_t (*cancel_download_task)(storage_adaptor_plugin_context_h context,
350                                                         int file_descriptor,
351                                                         storage_adaptor_error_code_h *error);
352
353         storage_error_code_t (*cancel_download_thumb_task)(storage_adaptor_plugin_context_h context,
354                                                         int file_descriptor,
355                                                         storage_adaptor_error_code_h *error);
356
357         // common (yet)
358         storage_error_code_t (*set_server_info)(storage_adaptor_plugin_context_h context,
359                                                         GHashTable *server_info,
360                                                         void *request,
361                                                         storage_adaptor_error_code_h *error,
362                                                         void *response);
363         // Optional end
364         // common
365         storage_error_code_t (*get_root_folder_path)(storage_adaptor_plugin_context_h context,
366                                                         void *request,
367                                                         char **root_folder_path,
368                                                         storage_adaptor_error_code_h *error,
369                                                         void *response);
370
371         // common
372         storage_error_code_t (*list)(storage_adaptor_plugin_context_h context,
373                                                         const char *parent_folder_storage_path,
374                                                         const char *folder_name,
375                                                         void *request,
376                                                         storage_adaptor_file_info_h **file_info_list,
377                                                         int *file_info_list_len,
378                                                         storage_adaptor_error_code_h *error,
379                                                         void *response);
380
381         // common
382         storage_error_code_t (*make_directory)(storage_adaptor_plugin_context_h context,
383                                                         const char *parent_folder_storage_path,
384                                                         const char *folder_name,
385                                                         void *request,
386                                                         storage_adaptor_file_info_h *file_info,
387                                                         storage_adaptor_error_code_h *error,
388                                                         void *response);
389
390         // common
391         storage_error_code_t (*upload_file_sync)(storage_adaptor_plugin_context_h context,
392                                                         const char *parent_folder_storage_path,
393                                                         const char *file_name,
394                                                         const char *upload_file_local_path,
395                                                         const int publish,
396                                                         void *request,
397                                                         storage_adaptor_file_info_h *file_info,
398                                                         storage_adaptor_error_code_h *error,
399                                                         void *response);
400
401         // common
402         storage_error_code_t (*download_file_sync)(storage_adaptor_plugin_context_h context,
403                                                         const char *parent_folder_storage_path,
404                                                         const char *file_name,
405                                                         const char *download_file_local_path,
406                                                         void *request,
407                                                         storage_adaptor_error_code_h *error,
408                                                         void *response);
409
410         // common
411         storage_error_code_t (*download_thumbnail)(storage_adaptor_plugin_context_h context,
412                                                         const char *folder_path,
413                                                         const char *file_name,
414                                                         const char *download_path,
415                                                         int thumbnail_size,
416                                                         void *request,
417                                                         storage_adaptor_error_code_h *error,
418                                                         void *response);
419
420         // common
421         storage_error_code_t (*delete_file)(storage_adaptor_plugin_context_h context,
422                                                         const char *parent_folder_storage_path,
423                                                         const char *file_name,
424                                                         void *request,
425                                                         storage_adaptor_file_info_h *file_info,
426                                                         storage_adaptor_error_code_h *error,
427                                                         void *response);
428
429         // common
430         storage_error_code_t (*remove_directory)(storage_adaptor_plugin_context_h context,
431                                                         const char *parent_folder_storage_path,
432                                                         const char *folder_name,
433                                                         void *request,
434                                                         storage_adaptor_file_info_h *file_info,
435                                                         storage_adaptor_error_code_h *error,
436                                                         void *response);
437
438         // common
439         storage_error_code_t (*move_file)(storage_adaptor_plugin_context_h context,
440                                                         const char *parent_folder_storage_path,
441                                                         const char *file_name,
442                                                         const char *dest_parent_folder_storage_path,
443                                                         const char *new_file_name,
444                                                         void *request,
445                                                         storage_adaptor_file_info_h *file_info,
446                                                         storage_adaptor_error_code_h *error,
447                                                         void *response);
448
449         // common
450         storage_error_code_t (*move_directory)(storage_adaptor_plugin_context_h context,
451                                                         const char *parent_folder_storage_path,
452                                                         const char *folder_name,
453                                                         const char *dest_parent_folder_storage_path,
454                                                         const char *new_folder_name,
455                                                         void *request,
456                                                         storage_adaptor_file_info_h *file_info,
457                                                         storage_adaptor_error_code_h *error,
458                                                         void *response);
459
460         // common
461         storage_error_code_t (*set_transfer_state)(storage_adaptor_plugin_context_h context,
462                                                         void *transfer_request_id,
463                                                         storage_adaptor_transfer_state_e state,
464                                                         void *request,
465                                                         storage_adaptor_error_code_h *error,
466                                                         void *response);
467
468         // common
469         storage_error_code_t (*get_transfer_state)(storage_adaptor_plugin_context_h context,
470                                                         void *transfer_request_id,
471                                                         void *request,
472                                                         storage_adaptor_transfer_state_e *state,
473                                                         storage_adaptor_error_code_h *error,
474                                                         void *response);
475
476
477         storage_error_code_t (*upload_file_async)(storage_adaptor_plugin_context_h context,
478                                                         const char *parent_folder_storage_path,
479                                                         const char *file_name,
480                                                         const char *upload_file_local_path,
481                                                         const int publish,
482                                                         void *request,
483                                                         void *transfer_request_id);
484
485         storage_error_code_t (*download_file_async)(storage_adaptor_plugin_context_h context,
486                                                         const char *parent_folder_storage_path,
487                                                         const char *file_name,
488                                                         const char *download_file_local_path,
489                                                         void *request,
490                                                         void *transfer_request_id);
491
492         storage_error_code_t (*download_file_sync_by_public_token)(storage_adaptor_plugin_context_h context,
493                                                         const char *public_token,
494                                                         const char *auth_code,
495                                                         const char *download_file_local_path,
496                                                         void *request,
497                                                         storage_adaptor_error_code_h *error,
498                                                         void *response);
499
500         storage_error_code_t (*download_file_async_by_public_token)(storage_adaptor_plugin_context_h context,
501                                                         const char *public_token,
502                                                         const char *auth_code,
503                                                         const char *download_file_local_path,
504                                                         void *request,
505                                                         void *transfer_request_id);
506
507         storage_error_code_t (*get_transfer_progress)(storage_adaptor_plugin_context_h context,
508                                                         void *transfer_request_id,
509                                                         void *request,
510                                                         unsigned long long *progress_size_byte,
511                                                         unsigned long long *total_size_byte,
512                                                         storage_adaptor_error_code_h *error,
513                                                         void *response);
514
515         storage_error_code_t (*set_meta)(storage_adaptor_plugin_context_h context,
516                                                         const char *parent_folder_storage_path,
517                                                         const char *file_name,
518                                                         const void *meta_data,
519                                                         void *request,
520                                                         storage_adaptor_file_info_h *file_info,
521                                                         storage_adaptor_error_code_h *error,
522                                                         void *response);
523
524         storage_error_code_t (*get_meta)(storage_adaptor_plugin_context_h context,
525                                                         const char *parent_folder_storage_path,
526                                                         const char *file_name,
527                                                         void *request,
528                                                         storage_adaptor_file_info_h *file_info,
529                                                         void **meta_data,
530                                                         storage_adaptor_error_code_h *error,
531                                                         void *response);
532
533         storage_error_code_t (*start_mupload)(storage_adaptor_plugin_context_h context,
534                                                         const char *parent_folder_storage_path,
535                                                         const char *file_name,
536                                                         const char *upload_file_local_path,
537                                                         const unsigned long long chunk_size_byte,
538                                                         void *request,
539                                                         char **mupload_key,
540                                                         int *chunk_count,
541                                                         storage_adaptor_file_info_h *file_info,
542                                                         storage_adaptor_error_code_h *error,
543                                                         void *response);
544
545         storage_error_code_t (*upload_mupload)(storage_adaptor_plugin_context_h context,
546                                                         const char *mupload_key,
547                                                         const int chunk_number,
548                                                         void *request,
549                                                         storage_adaptor_file_info_h *file_info,
550                                                         storage_adaptor_error_code_h *error,
551                                                         void *response);
552
553         storage_error_code_t (*end_mupload)(storage_adaptor_plugin_context_h context,
554                                                         const char *mupload_key,
555                                                         const int publish,
556                                                         void *request,
557                                                         storage_adaptor_file_info_h *file_info,
558                                                         storage_adaptor_error_code_h *error,
559                                                         void *response);
560
561         storage_error_code_t (*list_mupload)(storage_adaptor_plugin_context_h context,
562                                                         const char *mupload_key,
563                                                         void *request,
564                                                         storage_adaptor_file_info_h **file_info_list,
565                                                         int *file_info_list_len,
566                                                         storage_adaptor_error_code_h *error,
567                                                         void *response);
568
569         storage_error_code_t (*cancel_mupload)(storage_adaptor_plugin_context_h context,
570                                                         const char *mupload_key,
571                                                         void *request,
572                                                         storage_adaptor_file_info_h *file_info,
573                                                         storage_adaptor_error_code_h *error,
574                                                         void *response);
575
576         storage_error_code_t (*start_transaction)(storage_adaptor_plugin_context_h context,
577                                                         void *request,
578                                                         char **tx_key,
579                                                         storage_adaptor_error_code_h *error,
580                                                         void *response);
581
582         storage_error_code_t (*upload_file_transaction)(storage_adaptor_plugin_context_h context,
583                                                         const char *tx_key,
584                                                         const int tx_seq,
585                                                         const char *parent_folder_storage_path,
586                                                         const char *file_name,
587                                                         const char *upload_file_local_path,
588                                                         void *request,
589                                                         storage_adaptor_file_info_h *file_info,
590                                                         storage_adaptor_error_code_h *error,
591                                                         void *response);
592
593         storage_error_code_t (*set_dir_transaction)(storage_adaptor_plugin_context_h context,
594                                                         const char *tx_key,
595                                                         const int tx_seq,
596                                                         const char *parent_folder_storage_path,
597                                                         const char *folder_name,
598                                                         void *request,
599                                                         storage_adaptor_file_info_h *file_info,
600                                                         storage_adaptor_error_code_h *error,
601                                                         void *response);
602
603         storage_error_code_t (*delete_file_transaction)(storage_adaptor_plugin_context_h context,
604                                                         const char *tx_key,
605                                                         const int tx_seq,
606                                                         const char *parent_folder_storage_path,
607                                                         const char *file_name,
608                                                         void *request,
609                                                         storage_adaptor_file_info_h *file_info,
610                                                         storage_adaptor_error_code_h *error,
611                                                         void *response);
612
613         storage_error_code_t (*delete_dir_transaction)(storage_adaptor_plugin_context_h context,
614                                                         const char *tx_key,
615                                                         const int tx_seq,
616                                                         const char *parent_folder_storage_path,
617                                                         const char *folder_name,
618                                                         void *request,
619                                                         storage_adaptor_file_info_h *file_info,
620                                                         storage_adaptor_error_code_h *error,
621                                                         void *response);
622
623         storage_error_code_t (*end_transaction)(storage_adaptor_plugin_context_h context,
624                                                         const char *tx_key,
625                                                         const int tx_count,
626                                                         void *request,
627                                                         storage_adaptor_file_info_h **file_info_list,
628                                                         int *file_info_list_len,
629                                                         storage_adaptor_error_code_h *error,
630                                                         void *response);
631
632         storage_error_code_t (*list_transaction)(storage_adaptor_plugin_context_h context,
633                                                         const char *tx_key,
634                                                         void *request,
635                                                         storage_adaptor_file_info_h **file_info_list,
636                                                         int *file_info_list_len,
637                                                         storage_adaptor_error_code_h *error,
638                                                         void *response);
639
640         storage_error_code_t (*cancel_transaction)(storage_adaptor_plugin_context_h context,
641                                                         const char *tx_key,
642                                                         void *request,
643                                                         storage_adaptor_file_info_h **file_info_list,
644                                                         int *file_info_list_len,
645                                                         storage_adaptor_error_code_h *error,
646                                                         void *response);
647
648         storage_error_code_t (*multi_file_upload)(storage_adaptor_plugin_context_h context,
649                                                         const char *parent_folder_storage_path,
650                                                         const char **upload_file_local_path_list,
651                                                         const int upload_list_len,
652                                                         void *request,
653                                                         storage_adaptor_error_code_h *error,
654                                                         void *response);
655
656         storage_error_code_t (*multi_file_download)(storage_adaptor_plugin_context_h context,
657                                                         const char *parent_folder_storage_path,
658                                                         const char *file_name_list,
659                                                         const int file_name_list_len,
660                                                         const char *download_folder_local_path,
661                                                         void *request,
662                                                         storage_adaptor_file_info_h **file_info_list,
663                                                         int *file_info_list_len,
664                                                         storage_adaptor_error_code_h *error,
665                                                         void *response);
666
667         storage_error_code_t (*get_timestamp)(storage_adaptor_plugin_context_h context,
668                                                         void *request,
669                                                         unsigned long long *timestamp,
670                                                         storage_adaptor_error_code_h *error,
671                                                         void *response);
672
673         storage_error_code_t (*get_file_info_by_public_token)(storage_adaptor_plugin_context_h context,
674                                                         const char *public_token,
675                                                         const char *auth_code,
676                                                         void *request,
677                                                         storage_adaptor_file_info_h *file_info,
678                                                         storage_adaptor_error_code_h *error,
679                                                         void *response);
680
681         storage_error_code_t (*auth_public_authcode_by_public_token)(storage_adaptor_plugin_context_h context,
682                                                         const char *public_token,
683                                                         const char *auth_code,
684                                                         void *request,
685                                                         storage_adaptor_error_code_h *error,
686                                                         void *response);
687
688         storage_error_code_t (*redirect_url_by_public_token)(storage_adaptor_plugin_context_h context,
689                                                         const char *public_token,
690                                                         void *request,
691                                                         storage_adaptor_error_code_h *error,
692                                                         void *response);
693
694         storage_error_code_t (*create_resuming_upload_url)(storage_adaptor_plugin_context_h context,
695                                                         const char *parent_folder_storage_path,
696                                                         const char *file_name,
697                                                         const unsigned long long x_upload_content_length,
698                                                         void *request,
699                                                         storage_adaptor_error_code_h *error,
700                                                         void *response);
701
702         storage_error_code_t (*create_resuming_chunk_upload_url)(storage_adaptor_plugin_context_h context,
703                                                         const char *mupload_key,
704                                                         const int chunk_number,
705                                                         const unsigned long long x_upload_content_length,
706                                                         void *request,
707                                                         char **rupload_key,
708                                                         storage_adaptor_error_code_h *error,
709                                                         void *response);
710
711         storage_error_code_t (*resuming_upload)(storage_adaptor_plugin_context_h context,
712                                                         const char *rupload_key,
713                                                         const char *content_range,
714                                                         const unsigned long long content_length,
715                                                         void *request,
716                                                         storage_adaptor_error_code_h *error,
717                                                         void *response);
718
719         storage_error_code_t (*delete_multi_file_in_folder)(storage_adaptor_plugin_context_h context,
720                                                         const char *parent_folder_storage_path,
721                                                         const char **file_name_list,
722                                                         const int file_name_list_len,
723                                                         void *request,
724                                                         storage_adaptor_file_info_h **file_info_list,
725                                                         int *file_info_list_len,
726                                                         storage_adaptor_error_code_h *error,
727                                                         void *response);
728
729         storage_error_code_t (*get_policy)(storage_adaptor_plugin_context_h context,
730                                                         void *request,
731                                                         char ***allowed_extension,
732                                                         int *allowed_extension_len,
733                                                         storage_adaptor_error_code_h *error,
734                                                         void *response);
735
736         storage_error_code_t (*get_quota)(storage_adaptor_plugin_context_h context,
737                                                         void *request,
738                                                         unsigned long long *total_usage,
739                                                         unsigned long long *total_quota,
740                                                         storage_adaptor_error_code_h *error,
741                                                         void *response);
742
743         // Optional end
744
745         // Mandatory
746         char *plugin_uri;       // get from config file
747         // Mandatory end
748
749 } storage_adaptor_plugin_handle_t;
750 typedef struct storage_adaptor_plugin_handle_s *storage_adaptor_plugin_handle_h;
751
752 /**
753  * Callback function variable for service adaptor
754  */
755
756 // private feature
757 typedef void (*storage_adaptor_service_download_file_async_reply_cb)(void *transfer_request_id,
758                                                 char *download_file_local_path,
759                                                 storage_adaptor_error_code_h error,
760                                                 void *response);
761
762 typedef void (*storage_adaptor_service_upload_file_async_reply_cb)(void *transfer_request_id,
763                                                 storage_adaptor_file_info_h file_info,
764                                                 storage_adaptor_error_code_h error,
765                                                 void *response);
766
767 typedef void (*storage_adaptor_service_file_transfer_progress_reply_cb)(void *transfer_request_id,
768                                                 unsigned long long progress_size_byte,
769                                                 unsigned long long total_size_byte,
770                                                 storage_adaptor_error_code_h error,
771                                                 void *response);
772
773 // public feature
774 typedef void (*storage_adaptor_service_download_state_changed_reply_cb)(long long int file_descriptor,
775                                                 storage_adaptor_transfer_state_e state,
776                                                 storage_adaptor_error_code_h error,
777                                                 void *user_data);
778
779 typedef void (*storage_adaptor_service_upload_state_changed_reply_cb)(long long int file_descriptor,
780                                                 storage_adaptor_transfer_state_e state,
781                                                 storage_adaptor_file_info_h file_info,
782                                                 storage_adaptor_error_code_h error,
783                                                 void *user_data);
784
785 typedef void (*storage_adaptor_service_task_progress_reply_cb)(long long int file_descriptor,
786                                                 unsigned long long progress_size_byte,
787                                                 unsigned long long total_size_byte);
788
789
790
791 /**
792  * Storage adaptor listener for service adaptor
793  * Listener is used by service adaptor
794  */
795 typedef struct storage_adaptor_listener_s
796 {
797 // private feature
798         void (*download_file_async_reply)(void *transfer_request_id,
799                                                         char *download_file_local_path,
800                                                         storage_adaptor_error_code_h error,
801                                                         void *response);
802
803         void (*upload_file_async_reply)(void *transfer_request_id,
804                                                         storage_adaptor_file_info_h file_info,
805                                                         storage_adaptor_error_code_h error,
806                                                         void *response);
807
808         void (*file_transfer_progress_reply)(void *transfer_request_id,
809                                                         unsigned long long progress_size_byte,
810                                                         unsigned long long total_size_byte,
811                                                         storage_adaptor_error_code_h error,
812                                                         void *response);
813
814 // public feature
815         void (*download_state_changed_reply)(long long int file_descriptor,
816                                                 storage_adaptor_transfer_state_e state,
817                                                 storage_adaptor_error_code_h error,
818                                                 void *user_data);
819
820         void (*upload_state_changed_reply)(long long int file_descriptor,
821                                                 storage_adaptor_transfer_state_e state,
822                                                 storage_adaptor_file_info_h file_info,
823                                                 storage_adaptor_error_code_h error,
824                                                 void *user_data);
825
826         void (*task_progress_reply)(long long int file_descriptor,
827                                                 unsigned long long progress_size_byte,
828                                                 unsigned long long total_size_byte);
829
830 } storage_adaptor_listener_t;
831 typedef struct storage_adaptor_listener_s *storage_adaptor_listener_h;
832
833 /**
834  * Callback function variables for plugins
835  * These callbacks are expected to be support by plugins
836  */
837 // private feature
838 typedef void (*storage_adaptor_plugin_download_file_async_reply_cb)(void *transfer_request_id,
839                                                 char *download_file_local_path,
840                                                 storage_adaptor_error_code_h error,
841                                                 void *response);
842
843 typedef void (*storage_adaptor_plugin_upload_file_async_reply_cb)(void *transfer_request_id,
844                                                 storage_adaptor_file_info_h file_info,
845                                                 storage_adaptor_error_code_h error,
846                                                 void *response);
847
848 typedef void (*storage_adaptor_plugin_file_transfer_progress_reply_cb)(void *transfer_request_id,
849                                                 unsigned long long progress_size_byte,
850                                                 unsigned long long total_size_byte,
851                                                 storage_adaptor_error_code_h error,
852                                                 void *response);
853
854 // public feature
855 typedef void (*storage_adaptor_plugin_download_state_changed_reply_cb)(int file_descriptor,
856                                                 storage_adaptor_transfer_state_e state,
857                                                 storage_adaptor_error_code_h error,
858                                                 void *user_data);
859
860 typedef void (*storage_adaptor_plugin_upload_state_changed_reply_cb)(int file_descriptor,
861                                                 storage_adaptor_transfer_state_e state,
862                                                 storage_adaptor_file_info_h file_info,
863                                                 storage_adaptor_error_code_h error,
864                                                 void *user_data);
865
866 typedef void (*storage_adaptor_plugin_task_progress_reply_cb)(int file_descriptor,
867                                                 unsigned long long progress_size_byte,
868                                                 unsigned long long total_size_byte,
869                                                 storage_adaptor_error_code_h error,
870                                                 void *user_data);
871
872 /**
873  * Storage adaptor listener for plugins
874  * Listener is used by plugins
875  */
876 typedef struct storage_adaptor_plugin_listener_s
877 {
878 // private feature
879         storage_adaptor_plugin_download_file_async_reply_cb     storage_adaptor_download_file_async_reply;
880         storage_adaptor_plugin_upload_file_async_reply_cb       storage_adaptor_upload_file_async_reply;
881         storage_adaptor_plugin_file_transfer_progress_reply_cb  storage_adaptor_file_transfer_progress_reply;
882
883 // public feature
884         storage_adaptor_plugin_download_state_changed_reply_cb  storage_adaptor_download_state_changed_reply;
885         storage_adaptor_plugin_upload_state_changed_reply_cb    storage_adaptor_upload_state_changed_reply;
886         storage_adaptor_plugin_task_progress_reply_cb   storage_adaptor_task_progress_reply;
887 } storage_adaptor_plugin_listener_t;
888
889 /**
890  * Loads plugin from selected path
891  */
892 int storage_adaptor_load_plugin(storage_adaptor_h,
893                                                 const char *plugin_path);
894
895 // For 3rd party plugin packages
896 int storage_adaptor_load_plugin_from_package(storage_adaptor_h adaptor,
897                                                 const char *package_id,
898                                                 const char *plugin_path);
899
900 /**
901  * Unloads selected plugin
902  */
903 int storage_adaptor_unload_plugin(storage_adaptor_h,
904                                                 storage_adaptor_plugin_h);
905
906 /**
907  * Gets plugin name
908  */
909 void storage_adaptor_get_plugin_uri(storage_adaptor_plugin_h plugin,
910                                                 char **plugin_uri);
911
912 /**
913  * Refresh access token
914  */
915 EXPORT_API
916 storage_error_code_t storage_adaptor_refresh_access_token(storage_adaptor_plugin_context_h context,
917                                                 const char *new_access_token);
918
919 /**
920  * Refresh access token
921  */
922 EXPORT_API
923 storage_error_code_t storage_adaptor_refresh_uid(storage_adaptor_plugin_context_h context,
924                                                 const char *new_uid);
925
926 /**
927  * Create error code
928  */
929 EXPORT_API
930 storage_adaptor_error_code_h storage_adaptor_create_error_code(const int64_t code,
931                                                 const char *msg);
932
933 /**
934  * Destroy error code
935  */
936 EXPORT_API
937 void storage_adaptor_destroy_error_code(storage_adaptor_error_code_h *error_code);
938
939 /**
940  * Creates storage adaptor
941  */
942 EXPORT_API
943 storage_adaptor_h storage_adaptor_create(const char *plugins_dir);
944
945 /**
946  * Destroys storage adaptor
947  * Destroys storage adaptor. If storage adaptor was started it is stopped first.
948  */
949 EXPORT_API
950 void storage_adaptor_destroy(storage_adaptor_h adaptor);
951
952 /**
953  * Starts storage adaptor
954  * Starts storage adaptor and loads plugins that were found in plugins search dir
955  * specified in storage_adaptor_create
956  */
957 EXPORT_API
958 int storage_adaptor_start(storage_adaptor_h adaptor);
959
960 /**
961  * Stops storage adaptor.
962  */
963 EXPORT_API
964 int storage_adaptor_stop(storage_adaptor_h adaptor);
965
966 /**
967  * Registers plugin state listener
968  */
969 EXPORT_API
970 int storage_adaptor_register_listener(storage_adaptor_h,
971                                                 storage_adaptor_listener_h);
972
973 /**
974  * Unregisters plugin state listener
975  */
976 EXPORT_API
977 int storage_adaptor_unregister_listener(storage_adaptor_h,
978                                                 storage_adaptor_listener_h);
979
980 /**
981  * Creates plugin context.
982  */
983 EXPORT_API
984 storage_adaptor_plugin_context_h storage_adaptor_create_plugin_context(storage_adaptor_plugin_h plugin,
985                                                 const char *app_id,
986                                                 const char *app_secret,
987                                                 const char *access_token,
988                                                 const char *cid,
989                                                 const char *uid,
990                                                 const char *service_name);
991
992 /**
993  * Destroys plugin context.
994  */
995 EXPORT_API
996 void storage_adaptor_destroy_plugin_context(storage_adaptor_plugin_h plugin,
997                                                 storage_adaptor_plugin_context_h);
998
999 /**
1000  * Gets plugin with specified unique name
1001  */
1002 EXPORT_API
1003 storage_adaptor_plugin_h storage_adaptor_get_plugin_by_name(storage_adaptor_h adaptor,
1004                                                 const char *plugin_uri);
1005
1006 /**
1007  * Gets plugins
1008  */
1009 EXPORT_API
1010 GList *storage_adaptor_get_plugins(storage_adaptor_h adaptor);
1011
1012 ////////////////////////////////////////////////////////////
1013 // Adaptor Util Functions
1014 ////////////////////////////////////////////////////////////
1015 EXPORT_API
1016 storage_adaptor_file_info_h storage_adaptor_create_file_info(void);
1017
1018 EXPORT_API
1019 int storage_adaptor_destroy_file_info(storage_adaptor_file_info_h *file_info);
1020
1021
1022 ////////////////////////////////////////////////////////////
1023 // Adaptor Plugin call Functions
1024 ////////////////////////////////////////////////////////////
1025
1026
1027 EXPORT_API
1028 storage_error_code_t storage_adaptor_open_file(storage_adaptor_plugin_h plugin,
1029                                                 storage_adaptor_plugin_context_h context,
1030                                                 const char *file_path,
1031                                                 storage_adaptor_file_access_mode_e mode,
1032                                                 long long int *file_uid,
1033                                                 storage_adaptor_error_code_h *error);
1034
1035 EXPORT_API
1036 storage_error_code_t storage_adaptor_close_file(storage_adaptor_plugin_h plugin,
1037                                                 storage_adaptor_plugin_context_h context,
1038                                                 long long int file_uid,
1039                                                 storage_adaptor_error_code_h *error);
1040
1041 EXPORT_API
1042 storage_error_code_t storage_adaptor_start_upload_task(storage_adaptor_plugin_h plugin,
1043                                                 storage_adaptor_plugin_context_h context,
1044                                                 long long int src_file_descriptor,              // read only opened
1045                                                 const char *upload_dir_path,
1046                                                 const char *file_name,
1047                                                 bool need_progress,
1048                                                 storage_adaptor_error_code_h *error,
1049                                                 void *user_data);
1050
1051 EXPORT_API
1052 storage_error_code_t storage_adaptor_start_download_task(storage_adaptor_plugin_h plugin,
1053                                                 storage_adaptor_plugin_context_h context,
1054                                                 const char *storage_dir_path,
1055                                                 const char *file_name,
1056                                                 long long int dst_file_descriptor,              // write only opened
1057                                                 bool need_progress,
1058                                                 storage_adaptor_error_code_h *error,
1059                                                 void *user_data);
1060
1061 EXPORT_API
1062 storage_error_code_t storage_adaptor_start_download_thumb_task(storage_adaptor_plugin_h plugin,
1063                                                 storage_adaptor_plugin_context_h context,
1064                                                 const char *storage_dir_path,
1065                                                 const char *file_name,
1066                                                 long long int dst_file_descriptor,              // write only opened
1067                                                 int thumbnail_size,                     // level (defined plugin SPEC)
1068                                                 bool need_progress,
1069                                                 storage_adaptor_error_code_h *error,
1070                                                 void *user_data);
1071
1072 EXPORT_API
1073 storage_error_code_t storage_adaptor_cancel_upload_task(storage_adaptor_plugin_h plugin,
1074                                                 storage_adaptor_plugin_context_h context,
1075                                                 long long int file_uid,
1076                                                 storage_adaptor_error_code_h *error);
1077
1078 EXPORT_API
1079 storage_error_code_t storage_adaptor_cancel_download_task(storage_adaptor_plugin_h plugin,
1080                                                 storage_adaptor_plugin_context_h context,
1081                                                 long long int file_uid,
1082                                                 storage_adaptor_error_code_h *error);
1083
1084 EXPORT_API
1085 storage_error_code_t storage_adaptor_cancel_download_thumb_task(storage_adaptor_plugin_h plugin,
1086                                                 storage_adaptor_plugin_context_h context,
1087                                                 long long int file_uid,
1088                                                 storage_adaptor_error_code_h *error);
1089
1090 /**
1091 * @brief Set server information for Storage Plugin
1092 *
1093 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1094 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1095 * @param[in]    server_info                     specifies server information for Storage Plugin
1096 * @param[in]    request                         specifies optional parameter
1097 * @param[out]   error                           specifies error code
1098 * @param[out]   response                        specifies optional parameter
1099 * @return 0 on success, otherwise a positive error value
1100 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1101 */
1102 EXPORT_API
1103 storage_error_code_t storage_adaptor_set_server_info(storage_adaptor_plugin_h plugin,
1104                                                 storage_adaptor_plugin_context_h context,
1105                                                 GHashTable *server_info,
1106                                                 void *request,
1107                                                 storage_adaptor_error_code_h *error,
1108                                                 void *response);
1109
1110 /**
1111 * @brief Makes a directory at cloud
1112 *
1113 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1114 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1115 * @param[in]    parent_folder_storage_path      specifies path to locate the folder you want to create
1116 * @param[in]    folder_name                     specifies folder name to be created at cloud
1117 * @param[in]    request                         specifies optional parameter
1118 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1119 * @param[out]   error                           specifies error code
1120 * @param[out]   response                        specifies optional parameter
1121 * @return 0 on success, otherwise a positive error value
1122 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1123 */
1124 EXPORT_API
1125 storage_error_code_t storage_adaptor_make_directory(storage_adaptor_plugin_h plugin,
1126                                                 storage_adaptor_plugin_context_h context,
1127                                                 const char *parent_folder_storage_path,
1128                                                 const char *folder_name,
1129                                                 void *request,
1130                                                 storage_adaptor_file_info_h *file_info,
1131                                                 storage_adaptor_error_code_h *error,
1132                                                 void *response);
1133
1134 /**
1135 * @brief Removes a directory at cloud
1136 *
1137 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1138 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1139 * @param[in]    parent_folder_storage_path      specifies parent folder path of folder you want to delete
1140 * @param[in]    folder_name                     specifies folder name to be deleted from cloud
1141 * @param[in]    request                         specifies optional parameter
1142 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1143 * @param[out]   error                           specifies error code
1144 * @param[out]   response                        specifies optional parameter
1145 * @return 0 on success, otherwise a positive error value
1146 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1147 */
1148 EXPORT_API
1149 storage_error_code_t storage_adaptor_remove_directory(storage_adaptor_plugin_h plugin,
1150                                                 storage_adaptor_plugin_context_h context,
1151                                                 const char *parent_folder_storage_path,
1152                                                 const char *folder_name,
1153                                                 void *request,
1154                                                 storage_adaptor_file_info_h *file_info,
1155                                                 storage_adaptor_error_code_h *error,
1156                                                 void *response);
1157
1158 /**
1159 * @brief Requests folder and file list in a folder
1160 *
1161 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1162 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1163 * @param[in]    parent_folder_storage_path      specifies parent folder path of folder you want to get list
1164 * @param[in]    folder_name                     specifies folder name you want to get list
1165 * @param[in]    request                         specifies optional parameter
1166 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1167 * @param[out]   file_info_list_len              specifies length of the file_info_list
1168 * @param[out]   error                           specifies error code
1169 * @param[out]   response                        specifies optional parameter
1170 * @return 0 on success, otherwise a positive error value
1171 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1172 */
1173 EXPORT_API
1174 storage_error_code_t storage_adaptor_list(storage_adaptor_plugin_h plugin,
1175                                                 storage_adaptor_plugin_context_h context,
1176                                                 const char *parent_folder_storage_path,
1177                                                 const char *folder_name,
1178                                                 void *request,
1179                                                 storage_adaptor_file_info_h **file_info_list,
1180                                                 int *file_info_list_len,
1181                                                 storage_adaptor_error_code_h *error,
1182                                                 void *response);
1183
1184 /**
1185 * @brief Uploads a file to cloud (Sync)
1186 *
1187 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1188 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1189 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to upload
1190 * @param[in]    file_name                       specifies file name to be uploaded to cloud
1191 * @param[in]    upload_file_local_path          specifies local path of the file to be uploaded
1192 * @param[in]    publish                         specifies Allow to share file with no authentication
1193 * @param[in]    request                         specifies optional parameter
1194 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1195 * @param[out]   error                           specifies error code
1196 * @param[out]   response                        specifies optional parameter
1197 * @return 0 on success, otherwise a positive error value
1198 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1199 */
1200 EXPORT_API
1201 storage_error_code_t storage_adaptor_upload_file_sync(storage_adaptor_plugin_h plugin,
1202                                                 storage_adaptor_plugin_context_h context,
1203                                                 const char *parent_folder_storage_path,
1204                                                 const char *file_name,
1205                                                 const char *upload_file_local_path,
1206                                                 const int publish,
1207                                                 void *request,
1208                                                 storage_adaptor_file_info_h *file_info,
1209                                                 storage_adaptor_error_code_h *error,
1210                                                 void *response);
1211
1212 /**
1213 * @brief Uploads a file to cloud (Async)
1214 *
1215 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1216 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1217 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to upload
1218 * @param[in]    file_name                       specifies file name to be uploaded to cloud
1219 * @param[in]    upload_file_local_path          specifies local path of the file to be uploaded
1220 * @param[in]    publish                         specifies Allow to share file with no authentication
1221 * @param[in]    request                         specifies optional parameter
1222 * @param[out]   transfer_request_id             specifies
1223 * @param[out]   error                           specifies error code
1224 * @return 0 on success, otherwise a positive error value
1225 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1226 */
1227 EXPORT_API
1228 storage_error_code_t storage_adaptor_upload_file_async(storage_adaptor_plugin_h plugin,
1229                                                 storage_adaptor_plugin_context_h context,
1230                                                 const char *parent_folder_storage_path,
1231                                                 const char *file_name,
1232                                                 const char *upload_file_local_path,
1233                                                 const int publish,
1234                                                 void *request,
1235                                                 void *transfer_request_id,
1236                                                 storage_adaptor_error_code_h *error);
1237
1238 /**
1239 * @brief Downloads a file to local (Sync)
1240 *
1241 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1242 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1243 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to download
1244 * @param[in]    file_name                       specifies file name to be downloaded to local
1245 * @param[in]    download_file_local_path        specifies local path to download
1246 * @param[in]    request                         specifies optional parameter
1247 * @param[out]   error                           specifies error code
1248 * @param[out]   response                        specifies optional parameter
1249 * @return 0 on success, otherwise a positive error value
1250 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1251 */
1252 EXPORT_API
1253 storage_error_code_t storage_adaptor_download_file_sync(storage_adaptor_plugin_h plugin,
1254                                                 storage_adaptor_plugin_context_h context,
1255                                                 const char *parent_folder_storage_path,
1256                                                 const char *file_name,
1257                                                 const char *download_file_local_path,
1258                                                 void *request,
1259                                                 storage_adaptor_error_code_h *error,
1260                                                 void *response);
1261
1262 /**
1263 * @brief Downloads a file to local (Async)
1264 *
1265 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1266 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1267 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to download
1268 * @param[in]    file_name                       specifies file name to be downloaded to local
1269 * @param[in]    download_file_local_path        specifies local path to download
1270 * @param[in]    request                         specifies optional parameter
1271 * @param[out]   transfer_request_id             specifies
1272 * @param[out]   error                           specifies error code
1273 * @return 0 on success, otherwise a positive error value
1274 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1275 */
1276 EXPORT_API
1277 storage_error_code_t storage_adaptor_download_file_async(storage_adaptor_plugin_h plugin,
1278                                                 storage_adaptor_plugin_context_h context,
1279                                                 const char *parent_folder_storage_path,
1280                                                 const char *file_name,
1281                                                 const char *download_file_local_path,
1282                                                 void *request,
1283                                                 void *transfer_request_id,
1284                                                 storage_adaptor_error_code_h *error);
1285
1286 /**
1287 * @brief Downloads a thumbnail to local (Sync)
1288 *
1289 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1290 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1291 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to download
1292 * @param[in]    file_name                       specifies file name to be downloaded to local
1293 * @param[in]    download_file_local_path        specifies local path to download
1294 * @param[in]    thumbnail_size                  specifies thumbnail_size
1295 * @param[in]    request                         specifies optional parameter
1296 * @param[out]   error                           specifies error code
1297 * @param[out]   response                        specifies optional parameter
1298 * @return 0 on success, otherwise a positive error value
1299 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1300 */
1301 EXPORT_API
1302 storage_error_code_t storage_adaptor_download_thumbnail(storage_adaptor_plugin_h plugin,
1303                                                 storage_adaptor_plugin_context_h context,
1304                                                 const char *folder_path,
1305                                                 const char *file_name,
1306                                                 const char *download_path,
1307                                                 int thumbnail_size,
1308                                                 void *request,
1309                                                 storage_adaptor_error_code_h *error,
1310                                                 void *response);
1311
1312 /**
1313 * @brief Removes a file at cloud
1314 *
1315 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1316 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1317 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to delete
1318 * @param[in]    file_name                       specifies file name to be deleted from cloud
1319 * @param[in]    request                         specifies optional parameter
1320 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1321 * @param[out]   error                           specifies error code
1322 * @param[out]   response                        specifies optional parameter
1323 * @return 0 on success, otherwise a positive error value
1324 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1325 */
1326 EXPORT_API
1327 storage_error_code_t storage_adaptor_delete_file(storage_adaptor_plugin_h plugin,
1328                                                 storage_adaptor_plugin_context_h context,
1329                                                 const char *parent_folder_storage_path,
1330                                                 const char *file_name,
1331                                                 void *request,
1332                                                 storage_adaptor_file_info_h *file_info,
1333                                                 storage_adaptor_error_code_h *error,
1334                                                 void *response);
1335
1336 /**
1337 * @brief Sets metadata of file at cloud
1338 *
1339 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1340 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1341 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to set meta data
1342 * @param[in]    file_name                       specifies file name to be updated meta data
1343 * @param[in]    meta_data                       specifies meta data (A pair of Key, Value)
1344 * @param[in]    request                         specifies optional parameter
1345 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1346 * @param[out]   error                           specifies error code
1347 * @param[out]   response                        specifies optional parameter
1348 * @return 0 on success, otherwise a positive error value
1349 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1350 */
1351 EXPORT_API
1352 storage_error_code_t storage_adaptor_set_meta(storage_adaptor_plugin_h plugin,
1353                                                 storage_adaptor_plugin_context_h context,
1354                                                 const char *parent_folder_storage_path,
1355                                                 const char *file_name,
1356                                                 const void *meta_data,
1357                                                 void *request,
1358                                                 storage_adaptor_file_info_h *file_info,
1359                                                 storage_adaptor_error_code_h *error,
1360                                                 void *response);
1361
1362 /**
1363 * @brief Gets metatdata of file at cloud
1364 *
1365 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1366 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1367 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to get meta data
1368 * @param[in]    file_name                       specifies file name
1369 * @param[in]    request                         specifies optional parameter
1370 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1371 * @param[out]   meta_data                       specifies meta data (A pair of Key, Value)
1372 * @param[out]   error                           specifies error code
1373 * @param[out]   response                        specifies optional parameter
1374 * @return 0 on success, otherwise a positive error value
1375 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1376 */
1377 EXPORT_API
1378 storage_error_code_t storage_adaptor_get_meta(storage_adaptor_plugin_h plugin,
1379                                                 storage_adaptor_plugin_context_h context,
1380                                                 const char *parent_folder_storage_path,
1381                                                 const char *file_name,
1382                                                 void *request,
1383                                                 storage_adaptor_file_info_h *file_info,
1384                                                 void **meta_data,
1385                                                 storage_adaptor_error_code_h *error,
1386                                                 void *response);
1387
1388 /**
1389 * @brief Set up Multi Channel Upload
1390 *
1391 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1392 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1393 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to upload
1394 * @param[in]    file_name                       specifies file name to be uploaded to cloud
1395 * @param[in]    upload_file_local_path          specifies local path of the file to be uploaded
1396 * @param[in]    chunk_size_byte                 specifies size of chunk
1397 * @param[in]    request                         specifies optional parameter
1398 * @param[out]   mupload_key                     specifies Multi Channel Upload key
1399 * @param[out]   chunk_count                     specifies total number of chunks
1400 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1401 * @param[out]   error                           specifies error code
1402 * @param[out]   response                        specifies optional parameter
1403 * @return 0 on success, otherwise a positive error value
1404 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1405 */
1406 EXPORT_API
1407 storage_error_code_t storage_adaptor_start_mupload(storage_adaptor_plugin_h plugin,
1408                                                 storage_adaptor_plugin_context_h context,
1409                                                 const char *parent_folder_storage_path,
1410                                                 const char *file_name,
1411                                                 const char *upload_file_local_path,
1412                                                 const unsigned long long chunk_size_byte,
1413                                                 void *request,
1414                                                 char **mupload_key,
1415                                                 int *chunk_count,
1416                                                 storage_adaptor_file_info_h *file_info,
1417                                                 storage_adaptor_error_code_h *error,
1418                                                 void *response);
1419
1420 /**
1421 * @brief Uploads a chunk to cloud
1422 *
1423 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1424 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1425 * @param[in]    mupload_key                     specifies Multi Channel Upload key
1426 * @param[in]    chunk_number                    specifies number of chunk (Starting at 1)
1427 * @param[in]    request                         specifies optional parameter
1428 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1429 * @param[out]   error                           specifies error code
1430 * @param[out]   response                        specifies optional parameter
1431 * @return 0 on success, otherwise a positive error value
1432 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1433 */
1434 EXPORT_API
1435 storage_error_code_t storage_adaptor_upload_mupload(storage_adaptor_plugin_h plugin,
1436                                                 storage_adaptor_plugin_context_h context,
1437                                                 const char *mupload_key,
1438                                                 const int chunk_number,
1439                                                 void *request,
1440                                                 storage_adaptor_file_info_h *file_info,
1441                                                 storage_adaptor_error_code_h *error,
1442                                                 void *response);
1443
1444 /**
1445 * @brief Ends Multi channel Upload
1446 *
1447 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1448 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1449 * @param[in]    mupload_key                     specifies Multi Channel Upload key
1450 * @param[in]    publish                         specifies Allow to share file with no authentication
1451 * @param[in]    request                         specifies optional parameter
1452 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1453 * @param[out]   error                           specifies error code
1454 * @param[out]   response                        specifies optional parameter
1455 * @return 0 on success, otherwise a positive error value
1456 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1457 */
1458 EXPORT_API
1459 storage_error_code_t storage_adaptor_end_mupload(storage_adaptor_plugin_h plugin,
1460                                                 storage_adaptor_plugin_context_h context,
1461                                                 const char *mupload_key,
1462                                                 const int publish,
1463                                                 void *request,
1464                                                 storage_adaptor_file_info_h *file_info,
1465                                                 storage_adaptor_error_code_h *error,
1466                                                 void *response);
1467
1468 /**
1469 * @brief Requests list of chunks uploaded
1470 *
1471 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1472 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1473 * @param[in]    mupload_key                     specifies Multi Channel Upload key
1474 * @param[in]    request                         specifies optional parameter
1475 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1476 * @param[out]   file_info_list_len              specifies length of the file_info_list
1477 * @param[out]   error                           specifies error code
1478 * @param[out]   response                        specifies optional parameter
1479 * @return 0 on success, otherwise a positive error value
1480 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1481 */
1482 EXPORT_API
1483 storage_error_code_t storage_adaptor_list_mupload(storage_adaptor_plugin_h plugin,
1484                                                 storage_adaptor_plugin_context_h context,
1485                                                 const char *mupload_key,
1486                                                 void *request,
1487                                                 storage_adaptor_file_info_h **file_info_list,
1488                                                 int *file_info_list_len,
1489                                                 storage_adaptor_error_code_h *error,
1490                                                 void *response);
1491
1492 /**
1493 * @brief Cancels all operations
1494 *
1495 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1496 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1497 * @param[in]    mupload_key                     specifies Multi Channel Upload key
1498 * @param[in]    request                         specifies optional parameter
1499 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1500 * @param[out]   error                           specifies error code
1501 * @param[out]   response                        specifies optional parameter
1502 * @return 0 on success, otherwise a positive error value
1503 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1504 */
1505 EXPORT_API
1506 storage_error_code_t storage_adaptor_cancel_mupload(storage_adaptor_plugin_h plugin,
1507                                                 storage_adaptor_plugin_context_h context,
1508                                                 const char *mupload_key,
1509                                                 void *request,
1510                                                 storage_adaptor_file_info_h *file_info,
1511                                                 storage_adaptor_error_code_h *error,
1512                                                 void *response);
1513
1514 /**
1515 * @brief Starts Transaction
1516 *
1517 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1518 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1519 * @param[in]    request                         specifies optional parameter
1520 * @param[out]   tx_key                          specifies Transaction key
1521 * @param[out]   error                           specifies error code
1522 * @param[out]   response                        specifies optional parameter
1523 * @return 0 on success, otherwise a positive error value
1524 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1525 */
1526 EXPORT_API
1527 storage_error_code_t storage_adaptor_start_transaction(storage_adaptor_plugin_h plugin,
1528                                                 storage_adaptor_plugin_context_h context,
1529                                                 void *request,
1530                                                 char **tx_key,
1531                                                 storage_adaptor_error_code_h *error,
1532                                                 void *response);
1533
1534 /**
1535 * @brief Uploads a file
1536 *
1537 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1538 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1539 * @param[in]    tx_key                          specifies Transaction key
1540 * @param[in]    tx_seq                          specifies Transaction sequesnce (Starting at 1)
1541 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to upload
1542 * @param[in]    file_name                       specifies file name to be uploaded to cloud
1543 * @param[in]    upload_file_local_path          specifies local path of the file to be uploaded
1544 * @param[in]    request                         specifies optional parameter
1545 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1546 * @param[out]   error                           specifies error code
1547 * @param[out]   response                        specifies optional parameter
1548 * @return 0 on success, otherwise a positive error value
1549 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1550 */
1551 EXPORT_API
1552 storage_error_code_t storage_adaptor_upload_file_transaction(storage_adaptor_plugin_h plugin,
1553                                                 storage_adaptor_plugin_context_h context,
1554                                                 const char *tx_key,
1555                                                 const int tx_seq,
1556                                                 const char *parent_folder_storage_path,
1557                                                 const char *file_name,
1558                                                 const char *upload_file_local_path,
1559                                                 void *request,
1560                                                 storage_adaptor_file_info_h *file_info,
1561                                                 storage_adaptor_error_code_h *error,
1562                                                 void *response);
1563
1564 /**
1565 * @brief Updates a folder
1566 *
1567 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1568 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1569 * @param[in]    tx_key                          specifies Transaction key
1570 * @param[in]    tx_seq                          specifies Transaction sequesnce (Starting at 1)
1571 * @param[in]    parent_folder_storage_path      specifies folder path of folder you want to update
1572 * @param[in]    folder_name                     specifies folder name to be updated
1573 * @param[in]    request                         specifies optional parameter
1574 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1575 * @param[out]   error                           specifies error code
1576 * @param[out]   response                        specifies optional parameter
1577 * @return 0 on success, otherwise a positive error value
1578 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1579 */
1580 EXPORT_API
1581 storage_error_code_t storage_adaptor_set_dir_transaction(storage_adaptor_plugin_h plugin,
1582                                                 storage_adaptor_plugin_context_h context,
1583                                                 const char *tx_key,
1584                                                 const int tx_seq,
1585                                                 const char *parent_folder_storage_path,
1586                                                 const char *folder_name,
1587                                                 void *request,
1588                                                 storage_adaptor_file_info_h *file_info,
1589                                                 storage_adaptor_error_code_h *error,
1590                                                 void *response);
1591
1592 /**
1593 * @brief Removes a file
1594 *
1595 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1596 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1597 * @param[in]    tx_key                          specifies Transaction key
1598 * @param[in]    tx_seq                          specifies Transaction sequesnce (Starting at 1)
1599 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to delete
1600 * @param[in]    file_name                       specifies file name to be deleted from cloud
1601 * @param[in]    request                         specifies optional parameter
1602 * @param[in]    upload_file_local_path          specifies local path of the file to be uploaded
1603 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1604 * @param[out]   error                           specifies error code
1605 * @param[out]   response                        specifies optional parameter
1606 * @return 0 on success, otherwise a positive error value
1607 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1608 */
1609 EXPORT_API
1610 storage_error_code_t storage_adaptor_delete_file_transaction(storage_adaptor_plugin_h plugin,
1611                                                 storage_adaptor_plugin_context_h context,
1612                                                 const char *tx_key,
1613                                                 const int tx_seq,
1614                                                 const char *parent_folder_storage_path,
1615                                                 const char *file_name,
1616                                                 void *request,
1617                                                 storage_adaptor_file_info_h *file_info,
1618                                                 storage_adaptor_error_code_h *error,
1619                                                 void *response);
1620
1621 /**
1622 * @brief Removes a folder
1623 *
1624 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1625 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1626 * @param[in]    tx_key                          specifies Transaction key
1627 * @param[in]    tx_seq                          specifies Transaction sequesnce (Starting at 1)
1628 * @param[in]    parent_folder_storage_path      specifies folder path of folder you want to delete
1629 * @param[in]    folder_name                     specifies folder name to be deleted
1630 * @param[in]    request                         specifies optional parameter
1631 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1632 * @param[out]   error                           specifies error code
1633 * @param[out]   response                        specifies optional parameter
1634 * @return 0 on success, otherwise a positive error value
1635 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1636 */
1637 EXPORT_API
1638 storage_error_code_t storage_adaptor_delete_dir_transaction(storage_adaptor_plugin_h plugin,
1639                                                 storage_adaptor_plugin_context_h context,
1640                                                 const char *tx_key,
1641                                                 const int tx_seq,
1642                                                 const char *parent_folder_storage_path,
1643                                                 const char *folder_name,
1644                                                 void *request,
1645                                                 storage_adaptor_file_info_h *file_info,
1646                                                 storage_adaptor_error_code_h *error,
1647                                                 void *response);
1648
1649 /**
1650 * @brief Ends Transaction
1651 *
1652 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1653 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1654 * @param[in]    tx_key                          specifies Transaction key
1655 * @param[in]    tx_count                        specifies Transaction order count
1656 * @param[in]    request                         specifies optional parameter
1657 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1658 * @param[out]   file_info_list_len              specifies length of the file_info_list
1659 * @param[out]   error                           specifies error code
1660 * @param[out]   response                        specifies optional parameter
1661 * @return 0 on success, otherwise a positive error value
1662 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1663 */
1664 EXPORT_API
1665 storage_error_code_t storage_adaptor_end_transaction(storage_adaptor_plugin_h plugin,
1666                                                 storage_adaptor_plugin_context_h context,
1667                                                 const char *tx_key,
1668                                                 const int tx_count,
1669                                                 void *request,
1670                                                 storage_adaptor_file_info_h **file_info_list,
1671                                                 int *file_info_list_len,
1672                                                 storage_adaptor_error_code_h *error,
1673                                                 void *response);
1674
1675 /**
1676 * @brief Requests Transaction list
1677 *
1678 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1679 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1680 * @param[in]    tx_key                          specifies Transaction key
1681 * @param[in]    request                         specifies optional parameter
1682 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1683 * @param[out]   file_info_list_len              specifies length of the file_info_list
1684 * @param[out]   error                           specifies error code
1685 * @param[out]   response                        specifies optional parameter
1686 * @return 0 on success, otherwise a positive error value
1687 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1688 */
1689 EXPORT_API
1690 storage_error_code_t storage_adaptor_list_transaction(storage_adaptor_plugin_h plugin,
1691                                                 storage_adaptor_plugin_context_h context,
1692                                                 const char *tx_key,
1693                                                 void *request,
1694                                                 storage_adaptor_file_info_h **file_info_list,
1695                                                 int *file_info_list_len,
1696                                                 storage_adaptor_error_code_h *error,
1697                                                 void *response);
1698
1699 /**
1700 * @brief Cancels all transactions
1701 *
1702 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1703 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1704 * @param[in]    tx_key                          specifies Transaction key
1705 * @param[in]    request                         specifies optional parameter
1706 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1707 * @param[out]   file_info_list_len              specifies length of the file_info_list
1708 * @param[out]   error                           specifies error code
1709 * @param[out]   response                        specifies optional parameter
1710 * @return 0 on success, otherwise a positive error value
1711 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1712 */
1713 EXPORT_API
1714 storage_error_code_t storage_adaptor_cancel_transaction(storage_adaptor_plugin_h plugin,
1715                                                 storage_adaptor_plugin_context_h context,
1716                                                 const char *tx_key,
1717                                                 void *request,
1718                                                 storage_adaptor_file_info_h **file_info_list,
1719                                                 int *file_info_list_len,
1720                                                 storage_adaptor_error_code_h *error,
1721                                                 void *response);
1722
1723 /**
1724 * @brief Uploads multiple files to cloud
1725 *
1726 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1727 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1728 * @param[in]    parent_folder_storage_path      specifies folder path of files you want to upload
1729 * @param[in]    upload_file_local_path_list     specifies local path list of the files to be uploaded
1730 * @param[in]    upload_list_len                 specifies total number of files to be uploaded
1731 * @param[in]    request                         specifies optional parameter
1732 * @param[out]   error                           specifies error code
1733 * @param[out]   response                        specifies optional parameter
1734 * @return 0 on success, otherwise a positive error value
1735 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1736 */
1737 EXPORT_API
1738 storage_error_code_t storage_adaptor_multi_file_upload(storage_adaptor_plugin_h plugin,
1739                                                 storage_adaptor_plugin_context_h context,
1740                                                 const char *parent_folder_storage_path,
1741                                                 const char **upload_file_local_path_list,
1742                                                 const int upload_list_len,
1743                                                 void *request,
1744                                                 storage_adaptor_error_code_h *error,
1745                                                 void *response);
1746
1747 /**
1748 * @brief Downloads multiple files in a folder
1749 *
1750 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1751 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1752 * @param[in]    parent_folder_storage_path      specifies folder path of files you want to download
1753 * @param[in]    file_name_list                  specifies file name list to be downloaded
1754 * @param[in]    file_name_list_len              specifies total number of files to be downloaded
1755 * @param[in]    download_folder_local_path      specifies local folder path to download files
1756 * @param[in]    request                         specifies optional parameter
1757 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1758 * @param[out]   file_info_list_len              specifies length of the file_info_list
1759 * @param[out]   error                           specifies error code
1760 * @param[out]   response                        specifies optional parameter
1761 * @return 0 on success, otherwise a positive error value
1762 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1763 */
1764 EXPORT_API
1765 storage_error_code_t storage_adaptor_multi_file_download(storage_adaptor_plugin_h plugin,
1766                                                 storage_adaptor_plugin_context_h context,
1767                                                 const char *parent_folder_storage_path,
1768                                                 const char *file_name_list,
1769                                                 const int file_name_list_len,
1770                                                 const char *download_folder_local_path,
1771                                                 void *request,
1772                                                 storage_adaptor_file_info_h **file_info_list,
1773                                                 int *file_info_list_len,
1774                                                 storage_adaptor_error_code_h *error,
1775                                                 void *response);
1776
1777 /**
1778 * @brief Requests current server timestamp
1779 *
1780 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1781 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1782 * @param[in]    request                         specifies optional parameter
1783 * @param[out]   timestamp                       specifies server timestamp
1784 * @param[out]   error                           specifies error code
1785 * @param[out]   response                        specifies optional parameter
1786 * @return 0 on success, otherwise a positive error value
1787 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1788 */
1789 EXPORT_API
1790 storage_error_code_t storage_adaptor_get_timestamp(storage_adaptor_plugin_h plugin,
1791                                                 storage_adaptor_plugin_context_h context,
1792                                                 void *request,
1793                                                 unsigned long long *timestamp,
1794                                                 storage_adaptor_error_code_h *error,
1795                                                 void *response);
1796
1797 /**
1798 * @brief Requests a file info by public token
1799 *
1800 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1801 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1802 * @param[in]    public_token                    specifies token for Download, Get API
1803                                                 (when terminal upload file and add publish=true parameter, ors return public_token)
1804 * @param[in]    auth_code                       specifies Authentication code for public APIs
1805 * @param[in]    request                         specifies optional parameter
1806 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
1807 * @param[out]   error                           specifies error code
1808 * @param[out]   response                        specifies optional parameter
1809 * @return 0 on success, otherwise a positive error value
1810 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1811 */
1812 EXPORT_API
1813 storage_error_code_t storage_adaptor_get_file_info_by_public_token(storage_adaptor_plugin_h plugin,
1814                                                 storage_adaptor_plugin_context_h context,
1815                                                 const char *public_token,
1816                                                 const char *auth_code,
1817                                                 void *request,
1818                                                 storage_adaptor_file_info_h *file_info,
1819                                                 storage_adaptor_error_code_h *error,
1820                                                 void *response);
1821
1822 /**
1823 * @brief Downloads a file by public token (Sync)
1824 *
1825 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1826 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1827 * @param[in]    public_token                    specifies token for Download, Get API
1828                                                 (when terminal upload file and add publish=true parameter, ors return public_token)
1829 * @param[in]    auth_code                       specifies Authentication code for public APIs
1830 * @param[in]    download_file_local_path        specifies local path to download
1831 * @param[in]    request                         specifies optional parameter
1832 * @param[out]   error                           specifies error code
1833 * @param[out]   response                        specifies optional parameter
1834 * @return 0 on success, otherwise a positive error value
1835 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1836 */
1837 EXPORT_API
1838 storage_error_code_t storage_adaptor_download_file_sync_by_public_token(storage_adaptor_plugin_h plugin,
1839                                                 storage_adaptor_plugin_context_h context,
1840                                                 const char *public_token,
1841                                                 const char *auth_code,
1842                                                 const char *download_file_local_path,
1843                                                 void *request,
1844                                                 storage_adaptor_error_code_h *error,
1845                                                 void *response);
1846
1847 /**
1848 * @brief Downloads a file by public token (Async)
1849 *
1850 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1851 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1852 * @param[in]    public_token                    specifies token for Download, Get API
1853                                                 (when terminal upload file and add publish=true parameter, ors return public_token)
1854 * @param[in]    auth_code                       specifies Authentication code for public APIs
1855 * @param[in]    download_file_local_path        specifies local path to download
1856 * @param[in]    request                         specifies optional parameter
1857 * @param[out]   transfer_request_id             specifies
1858 * @param[out]   error                           specifies error code
1859 * @return 0 on success, otherwise a positive error value
1860 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1861 */
1862 EXPORT_API
1863 storage_error_code_t storage_adaptor_download_file_async_by_public_token(storage_adaptor_plugin_h plugin,
1864                                                 storage_adaptor_plugin_context_h context,
1865                                                 const char *public_token,
1866                                                 const char *auth_code,
1867                                                 const char *download_file_local_path,
1868                                                 void *request,
1869                                                 void *transfer_request_id,
1870                                                 storage_adaptor_error_code_h *error);
1871
1872 /**
1873 * @brief Authenticates public auth code
1874 *
1875 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1876 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1877 * @param[in]    public_token                    specifies token for Download, Get API
1878                                                 (when terminal upload file and add publish=true parameter, ors return public_token)
1879 * @param[in]    auth_code                       specifies Authentication code for public APIs
1880 * @param[in]    request                         specifies optional parameter
1881 * @param[out]   error                           specifies error code
1882 * @param[out]   response                        specifies optional parameter
1883 * @return 0 on success, otherwise a positive error value
1884 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1885 */
1886 EXPORT_API
1887 storage_error_code_t storage_adaptor_auth_public_authcode_by_public_token(storage_adaptor_plugin_h plugin,
1888                                                 storage_adaptor_plugin_context_h context,
1889                                                 const char *public_token,
1890                                                 const char *auth_code,
1891                                                 void *request,
1892                                                 storage_adaptor_error_code_h *error,
1893                                                 void *response);
1894
1895 /**
1896 * @brief Removes multiple files in a folder
1897 *
1898 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1899 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1900 * @param[in]    parent_folder_storage_path      specifies folder path of files you want to delete
1901 * @param[in]    file_name_list                  specifies file name list to be deleted
1902 * @param[in]    file_name_list_len              specifies total number of files to be deleted
1903 * @param[in]    request                         specifies optional parameter
1904 * @param[out]   file_info_list                  specifies Storage Adaptor File Info handle
1905 * @param[out]   file_info_list_len              specifies length of the file_info_list
1906 * @param[out]   error                           specifies error code
1907 * @param[out]   response                        specifies optional parameter
1908 * @return 0 on success, otherwise a positive error value
1909 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1910 */
1911 EXPORT_API
1912 storage_error_code_t storage_adaptor_delete_multi_file_in_folder(storage_adaptor_plugin_h plugin,
1913                                                 storage_adaptor_plugin_context_h context,
1914                                                 const char *parent_folder_storage_path,
1915                                                 const char **file_name_list,
1916                                                 const int file_name_list_len,
1917                                                 void *request,
1918                                                 storage_adaptor_file_info_h **file_info_list,
1919                                                 int *file_info_list_len,
1920                                                 storage_adaptor_error_code_h *error,
1921                                                 void *response);
1922
1923 /**
1924 * @brief Requests policy for upload
1925 *
1926 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1927 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1928 * @param[in]    request                         specifies optional parameter
1929 * @param[out]   allowed_extension               specifies
1930 * @param[out]   allowed_extension_len           specifies length of allowed_extension
1931 * @param[out]   error                           specifies error code
1932 * @param[out]   response                        specifies optional parameter
1933 * @return 0 on success, otherwise a positive error value
1934 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1935 */
1936 EXPORT_API
1937 storage_error_code_t storage_adaptor_get_policy(storage_adaptor_plugin_h plugin,
1938                                                 storage_adaptor_plugin_context_h context,
1939                                                 void *request,
1940                                                 char ***allowed_extension,
1941                                                 int *allowed_extension_len,
1942                                                 storage_adaptor_error_code_h *error,
1943                                                 void *response);
1944
1945 /**
1946 * @brief Requests quota of user
1947 *
1948 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1949 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1950 * @param[in]    request                         specifies optional parameter
1951 * @param[out]   total_usage                     specifies total usage of user
1952 * @param[out]   total_quota                     specifies total quota of user
1953 * @param[out]   error                           specifies error code
1954 * @param[out]   response                        specifies optional parameter
1955 * @return 0 on success, otherwise a positive error value
1956 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1957 */
1958 EXPORT_API
1959 storage_error_code_t storage_adaptor_get_quota(storage_adaptor_plugin_h plugin,
1960                                                 storage_adaptor_plugin_context_h context,
1961                                                 void *request,
1962                                                 unsigned long long *total_usage,
1963                                                 unsigned long long *total_quota,
1964                                                 storage_adaptor_error_code_h *error,
1965                                                 void *response);
1966
1967 /**
1968 * @brief Requests Redirect URL mapped with public token (Not yet supported)
1969 *
1970 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1971 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1972 * @param[in]    public_token                    specifies token for Download, Get API
1973                                                 (when terminal upload file and add publish=true parameter, ors return public_token)
1974 * @param[in]    request                         specifies optional parameter
1975 * @param[out]   error                           specifies error code
1976 * @param[out]   response                        specifies optional parameter
1977 * @return 0 on success, otherwise a positive error value
1978 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
1979 */
1980 EXPORT_API
1981 storage_error_code_t storage_adaptor_redirect_url_by_public_token(storage_adaptor_plugin_h plugin,
1982                                                 storage_adaptor_plugin_context_h context,
1983                                                 const char *public_token,
1984                                                 void *request,
1985                                                 storage_adaptor_error_code_h *error,
1986                                                 void *response);
1987
1988 /**
1989 * @brief Creates Upload URL (Not yet supported)
1990 *
1991 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
1992 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
1993 * @param[in]    parent_folder_storage_path      specifies folder path of files you want to upload
1994 * @param[in]    file_name                       specifies file name to be uploaded
1995 * @param[in]    x_upload_content_length         specifies length of content
1996 * @param[in]    request                         specifies optional parameter
1997 * @param[out]   error                           specifies error code
1998 * @param[out]   response                        specifies optional parameter
1999 * @return 0 on success, otherwise a positive error value
2000 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2001 */
2002 EXPORT_API
2003 storage_error_code_t storage_adaptor_create_resuming_upload_url(storage_adaptor_plugin_h plugin,
2004                                                 storage_adaptor_plugin_context_h context,
2005                                                 const char *parent_folder_storage_path,
2006                                                 const char *file_name,
2007                                                 const unsigned long long x_upload_content_length,
2008                                                 void *request,
2009                                                 storage_adaptor_error_code_h *error,
2010                                                 void *response);
2011
2012 /**
2013 * @brief Creates chunk Upload URL (Not yet supported)
2014 *
2015 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2016 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2017 * @param[in]    mupload_key                     specifies Multi Channel Upload key
2018 * @param[in]    chunk_number                    specifies number of chunk (Starting at 1)
2019 * @param[in]    x_upload_content_length         specifies length of content
2020 * @param[in]    request                         specifies optional parameter
2021 * @param[out]   rupload_key                     specifies Resuming Upload key
2022 * @param[out]   error                           specifies error code
2023 * @param[out]   response                        specifies optional parameter
2024 * @return 0 on success, otherwise a positive error value
2025 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2026 */
2027 EXPORT_API
2028 storage_error_code_t storage_adaptor_create_resuming_chunk_upload_url(storage_adaptor_plugin_h plugin,
2029                                                 storage_adaptor_plugin_context_h context,
2030                                                 const char *mupload_key,
2031                                                 const int chunk_number,
2032                                                 const unsigned long long x_upload_content_length,
2033                                                 void *request,
2034                                                 char **rupload_key,
2035                                                 storage_adaptor_error_code_h *error,
2036                                                 void *response);
2037
2038 /**
2039 * @brief Resumes Upload (Not yet supported)
2040 *
2041 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2042 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2043 * @param[in]    rupload_key                     specifies Resuming Upload key
2044 * @param[in]    content_range                   specifies range of content
2045 * @param[in]    content_length                  specifies length of content
2046 * @param[in]    request                         specifies optional parameter
2047 * @param[out]   error                           specifies error code
2048 * @param[out]   response                        specifies optional parameter
2049 * @return 0 on success, otherwise a positive error value
2050 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2051 */
2052 EXPORT_API
2053 storage_error_code_t storage_adaptor_resuming_upload(storage_adaptor_plugin_h plugin,
2054                                                 storage_adaptor_plugin_context_h context,
2055                                                 const char *rupload_key,
2056                                                 const char *content_range,
2057                                                 const unsigned long long content_length,
2058                                                 void *request,
2059                                                 storage_adaptor_error_code_h *error,
2060                                                 void *response);
2061
2062 /**
2063 * @brief Move a folder into destination folder
2064 *
2065 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2066 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2067 * @param[in]    parent_folder_storage_path      specifies parent folder path of folder you want to move
2068 * @param[in]    folder_name                     specifies folder name to be moved
2069 * @param[in]    dest_parent_folder_storage_path specifies new parent folder path
2070 * @param[in]    new_folder_name                 specifies new folder name
2071 * @param[in]    request                         specifies optional parameter
2072 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
2073 * @param[out]   error                           specifies error code
2074 * @param[out]   response                        specifies optional parameter
2075 * @return 0 on success, otherwise a positive error value
2076 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2077 */
2078 EXPORT_API
2079 storage_error_code_t storage_adaptor_move_directory(storage_adaptor_plugin_h plugin,
2080                                                 storage_adaptor_plugin_context_h context,
2081                                                 const char *parent_folder_storage_path,
2082                                                 const char *folder_name,
2083                                                 const char *dest_parent_folder_storage_path,
2084                                                 const char *new_folder_name,
2085                                                 void *request,
2086                                                 storage_adaptor_file_info_h *file_info,
2087                                                 storage_adaptor_error_code_h *error,
2088                                                 void *response);
2089
2090 /**
2091 * @brief Move a file into destination folder
2092 *
2093 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2094 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2095 * @param[in]    parent_folder_storage_path      specifies folder path of file you want to move
2096 * @param[in]    file_name                       specifies file name to be moved
2097 * @param[in]    dest_parent_folder_storage_path specifies new folder path
2098 * @param[in]    new_file_name                   specifies new file name
2099 * @param[in]    request                         specifies optional parameter
2100 * @param[out]   file_info                       specifies Storage Adaptor File Info handle
2101 * @param[out]   error                           specifies error code
2102 * @param[out]   response                        specifies optional parameter
2103 * @return 0 on success, otherwise a positive error value
2104 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2105 */
2106 EXPORT_API
2107 storage_error_code_t storage_adaptor_move_file(storage_adaptor_plugin_h plugin,
2108                                                 storage_adaptor_plugin_context_h context,
2109                                                 const char *parent_folder_storage_path,
2110                                                 const char *file_name,
2111                                                 const char *dest_parent_folder_storage_path,
2112                                                 const char *new_file_name,
2113                                                 void *request,
2114                                                 storage_adaptor_file_info_h *file_info,
2115                                                 storage_adaptor_error_code_h *error,
2116                                                 void *response);
2117
2118 /**
2119 * @brief Get progress of file transfer request
2120 *
2121 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2122 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2123 * @param[in]    transfer_request_id             specifies unique id for file transfer request
2124 * @param[in]    request                         specifies optional parameter
2125 * @param[out]   progress_size                   specifies current progress size
2126 * @param[out]   total_size                      specifies total size to transfer
2127 * @param[out]   error                           specifies error code
2128 * @param[out]   response                        specifies optional parameter
2129 * @return 0 on success, otherwise a positive error value
2130 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2131 */
2132 EXPORT_API
2133 storage_error_code_t storage_adaptor_get_transfer_progress(storage_adaptor_plugin_h plugin,
2134                                                 storage_adaptor_plugin_context_h context,
2135                                                 void *transfer_request_id,
2136                                                 void *request,
2137                                                 unsigned long long *progress_size_byte,
2138                                                 unsigned long long *total_size_byte,
2139                                                 storage_adaptor_error_code_h *error,
2140                                                 void *response);
2141
2142 /**
2143 * @brief Get state of file transfer request
2144 *
2145 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2146 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2147 * @param[in]    transfer_request_id             specifies unique id for file transfer request
2148 * @param[in]    request                         specifies optional parameter
2149 * @param[out]   state                          specifies current state of transfer request
2150 * @param[out]   error                           specifies error code
2151 * @param[out]   response                        specifies optional parameter
2152 * @return 0 on success, otherwise a positive error value
2153 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2154 */
2155 EXPORT_API
2156 storage_error_code_t storage_adaptor_get_transfer_state(storage_adaptor_plugin_h plugin,
2157                                                 storage_adaptor_plugin_context_h context,
2158                                                 void *transfer_request_id,
2159                                                 void *request,
2160                                                 storage_adaptor_transfer_state_e *state,
2161                                                 storage_adaptor_error_code_h *error,
2162                                                 void *response);
2163
2164 /**
2165 * @brief Set state of file transfer request
2166 *
2167 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2168 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2169 * @param[in]    transfer_request_id             specifies unique id for file transfer request
2170 * @param[in]    state                          specifies state to set
2171 * @param[in]    request                         specifies optional parameter
2172 * @param[out]   error                           specifies error code
2173 * @param[out]   response                        specifies optional parameter
2174 * @return 0 on success, otherwise a positive error value
2175 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2176 */
2177 EXPORT_API
2178 storage_error_code_t storage_adaptor_set_transfer_state(storage_adaptor_plugin_h plugin,
2179                                                 storage_adaptor_plugin_context_h context,
2180                                                 void *transfer_request_id,
2181                                                 storage_adaptor_transfer_state_e state,
2182                                                 void *request,
2183                                                 storage_adaptor_error_code_h *error,
2184                                                 void *response);
2185
2186 /**
2187 * @brief Requests root folder path
2188 *
2189 * @param[in]    plugin                          specifies Storage Adaptor Plugin handle
2190 * @param[in]    context                         specifies Storage Adaptor Plugin Context handle
2191 * @param[in]    request                         specifies optional parameter
2192 * @param[out]   root_folder_path        specifies root folder path
2193 * @param[out]   error                           specifies error code
2194 * @param[out]   response                        specifies optional parameter
2195 * @return 0 on success, otherwise a positive error value
2196 * @retval error code defined in storage_error_code_t - STORAGE_ADAPTOR_ERROR_NONE if Successful
2197 */
2198 EXPORT_API
2199 storage_error_code_t storage_adaptor_get_root_folder_path(storage_adaptor_plugin_h plugin,
2200                                                 storage_adaptor_plugin_context_h context,
2201                                                 void *request,
2202                                                 char **root_folder_path,
2203                                                 storage_adaptor_error_code_h *error,
2204                                                 void *response);
2205
2206 #ifdef __cplusplus
2207 }
2208 #endif
2209
2210 #endif /* __STORAGE_ADAPTOR_H__ */