예제 #1
0
        /**
         * download file from storage server
         *
         * @param file_id  the file id(including group name and filename)
         * @param callback the callback object, will call callback.recv() when data arrive
         * @return 0 success, return none zero errno if fail
         */
        public int download_file1(String file_id, IDownloadCallback callback)
        {
            long file_offset    = 0;
            long download_bytes = 0;

            return(this.download_file1(file_id, file_offset, download_bytes, callback));
        }
예제 #2
0
 public static async Task DownloadFileAsync(StorageNode storageNode, string fileName,
                                            IDownloadCallback downloadCallback,
                                            long offset = 0,
                                            long length = 0)
 {
     await DOWNLOAD_FILE.Instance
     .GetRequest(storageNode,
                 fileName,
                 Tuple.Create(offset, length),
                 downloadCallback)
     .GetResponseAsync <DOWNLOAD_FILE.Response>();
 }
예제 #3
0
        /**
         * download file from storage server
         *
         * @param file_id        the file id(including group name and filename)
         * @param file_offset    the start offset of the file
         * @param download_bytes download bytes, 0 for remain bytes from offset
         * @param callback       the callback object, will call callback.recv() when data arrive
         * @return 0 success, return none zero errno if fail
         */
        public int download_file1(String file_id, long file_offset, long download_bytes, IDownloadCallback callback)
        {
            String[] parts = new String[2];
            this.errno = split_file_id(file_id, parts);
            if (this.errno != 0)
            {
                return(this.errno);
            }

            return(this.download_file(parts[0], parts[1], file_offset, download_bytes, callback));
        }