com.luhuiguo.fastdfs.proto.storage.StorageDownloadCommand Maven / Gradle / Ivy
The newest version!
package com.luhuiguo.fastdfs.proto.storage;
import com.luhuiguo.fastdfs.proto.AbstractFdfsCommand;
import com.luhuiguo.fastdfs.proto.storage.internal.StorageDownloadRequest;
import com.luhuiguo.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);
}
}