/** * download file from storage server * * @param file_id the file id(including group name and filename) * @param local_filename the filename on local * @return 0 success, return none zero errno if fail */ public int download_file1(String file_id, String local_filename) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, local_filename); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @return file content/buffer, return null if fail */ public byte[] download_file1(String file_id) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes); }
/** * 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, DownloadCallback callback) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, callback); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @param local_filename the filename on local * @return 0 success, return none zero errno if fail */ public int download_file1(String file_id, String local_filename) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, local_filename); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @param local_filename the filename on local * @return 0 success, return none zero errno if fail */ public int download_file1(String file_id, String local_filename) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, local_filename); }
/** * 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, DownloadCallback callback) throws IOException, FsException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, callback); }
/** * 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, DownloadCallback callback) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, callback); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @return file content/buffer, return null if fail */ public byte[] download_file1(String file_id) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes); }
/** * 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, DownloadCallback callback) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, callback); }
/** * download file from storage server * @param file_id the file id(including group name and filename) * @return file content/buffer, return null if fail */ public byte[] download_file1(String file_id) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes); }
/** * download file from storage server * @param file_id the file id(including group name and filename) * @param local_filename the filename on local * @return 0 success, return none zero errno if fail */ public int download_file1(String file_id, String local_filename) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, local_filename); }
/** * 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, DownloadCallback callback) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, callback); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @return file content/buffer, return null if fail */ public byte[] download_file1(String file_id) throws IOException, FsException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @param local_filename the filename on local * @return 0 success, return none zero errno if fail */ public int download_file1(String file_id, String local_filename) throws IOException, FsException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes, local_filename); }
/** * download file from storage server * * @param file_id the file id(including group name and filename) * @return file content/buffer, return null if fail */ public byte[] download_file1(String file_id) throws IOException, MyException { final long file_offset = 0; final long download_bytes = 0; return this.download_file1(file_id, file_offset, download_bytes); }
public int downloadFile(String file_id) throws Exception { int errno; StorageServer storageServer = null; StorageClient1 client = new StorageClient1(trackerServer, storageServer); try { errno = client.download_file1(file_id, this.callback); if (errno != 0) { System.out.println("Download file fail, file_id: " + file_id + ", error no: " + errno); } return errno; } catch(Exception ex) { System.out.println("Download file fail, error mesg: " + ex.getMessage()); return -1; } } }
byte[] result = client.download_file1(fileId); System.out.println(i + ", download result is: " + result.length);
file_buff = client.download_file1(appender_file_id); System.out.println("download_file time used: " + (System.currentTimeMillis() - startTime) + " ms"); System.err.println("file url: " + file_url); errno = client.download_file1(appender_file_id, 0, 0, "c:\\" + appender_file_id.replaceAll("/", "_")); if (errno == 0) errno = client.download_file1(appender_file_id, 0, 0, new DownloadFileWriter("c:\\" + appender_file_id.replaceAll("/", "-"))); if (errno == 0)
file_buff = client.download_file1(file_id); if (file_buff != null) errno = client.download_file1(file_id, 0, 100, "c:\\" + file_id.replaceAll("/", "_")); if (errno == 0) errno = client.download_file1(file_id, new DownloadFileWriter("c:\\" + file_id.replaceAll("/", "-"))); if (errno == 0)