com.github.tobato.fastdfs.proto.storage.StorageDownloadCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastdfs-client Show documentation
Show all versions of fastdfs-client Show documentation
基于yuqih发布的代码与fastdfs-client 官方1.26版本的重构
package com.github.tobato.fastdfs.proto.storage;
import com.github.tobato.fastdfs.proto.AbstractFdfsCommand;
import com.github.tobato.fastdfs.proto.storage.internal.StorageDownloadRequest;
import com.github.tobato.fastdfs.proto.storage.internal.StorageDownloadResponse;
/**
* 文件下载命令
*
* @author tobato
* @param
*
*/
public class StorageDownloadCommand extends AbstractFdfsCommand {
/**
* 下载文件
*
* @param groupName
* @param path
* @param fileOffset
* @param fileSize
*/
public StorageDownloadCommand(String groupName, String path, long fileOffset, long fileSize,
DownloadCallback callback) {
super();
this.request = new StorageDownloadRequest(groupName, path, fileOffset, fileSize);
// 输出响应
this.response = new StorageDownloadResponse(callback);
}
/**
* 下载文件
*
* @param groupName
* @param path
*/
public StorageDownloadCommand(String groupName, String path, DownloadCallback callback) {
super();
this.request = new StorageDownloadRequest(groupName, path, 0, 0);
// 输出响应
this.response = new StorageDownloadResponse(callback);
}
}