public class GodfsApiClientImpl extends Object implements GodfsApiClient
| Modifier and Type | Method and Description |
|---|---|
void |
download(String path,
IReader byteReceiver) |
void |
download(String path,
long start,
long offset,
IReader byteReceiver)
download file using file path which pattern like 'G01/001/S/<md5>'
|
static GodfsApiClient |
getInstance(ClientConfigurationBean configuration) |
FileEntity |
query(String pathOrMd5)
query file info from tracker server.
|
String |
upload(File file)
upload local file.
|
String |
upload(File file,
String group,
IMonitor<MonitorProgressBean> monitor)
upload local file.
|
String |
upload(javax.servlet.http.HttpServletRequest request)
streaming api for uploading file.
NOTE: this way needs storage server enable http upload. |
String |
upload(javax.servlet.http.HttpServletRequest request,
String group,
IMonitor<MonitorProgressBean> monitor,
String protocol)
streaming api for uploading file.
NOTE: this way needs storage server enable http upload. |
String |
upload(InputStream ips,
long fileSize)
upload file in stream mode.
|
String |
upload(InputStream ips,
long fileSize,
String group,
IMonitor<MonitorProgressBean> monitor)
upload file in stream mode.
|
public static final GodfsApiClient getInstance(ClientConfigurationBean configuration)
public FileEntity query(String pathOrMd5) throws Exception
GodfsApiClientquery in interface GodfsApiClientpathOrMd5 - path like "G01/001/90234afcbba2314123112390234afcbb" or just a file md5Exceptionpublic String upload(InputStream ips, long fileSize) throws Exception
GodfsApiClientupload in interface GodfsApiClientExceptionpublic String upload(InputStream ips, long fileSize, String group, IMonitor<MonitorProgressBean> monitor) throws Exception
GodfsApiClientupload in interface GodfsApiClientgroup - the group of the filemonitor - upload progress monitorExceptionpublic String upload(File file) throws Exception
GodfsApiClientupload in interface GodfsApiClientfile - the file to be uploadedExceptionpublic String upload(File file, String group, IMonitor<MonitorProgressBean> monitor) throws Exception
GodfsApiClientupload in interface GodfsApiClientfile - the file to be uploadedgroup - the group of the filemonitor - upload progress monitorExceptionpublic String upload(javax.servlet.http.HttpServletRequest request, String group, IMonitor<MonitorProgressBean> monitor, String protocol) throws Exception
GodfsApiClientupload in interface GodfsApiClientrequest - the http request, if you are using spring ---------------------------group - the group of the filemonitor - upload progress monitorprotocol - only http or https, default is http.Exceptionpublic String upload(javax.servlet.http.HttpServletRequest request) throws Exception
GodfsApiClientupload in interface GodfsApiClientrequest - the http request, if you are using spring ---------------------------Exceptionpublic void download(String path, long start, long offset, IReader byteReceiver) throws Exception
GodfsApiClientdownload in interface GodfsApiClientpath - file path which pattern like 'G01/001/S/<md5>'start - download file start position.offset - download bytes offset, -1 represents the end of the file.byteReceiver - byte receiver handling download file bytes.Exceptionpublic void download(String path, IReader byteReceiver) throws Exception
download in interface GodfsApiClientExceptionGodfsApiClient.download(String, long, long, IReader)Copyright © 2018. All rights reserved.