com.jeesuite.filesystem.sdk.fdfs.codec.FileMetadataSetEncoder Maven / Gradle / Ivy
/**
*
*/
package com.jeesuite.filesystem.sdk.fdfs.codec;
import com.jeesuite.filesystem.sdk.fdfs.FastdfsConstants;
import com.jeesuite.filesystem.sdk.fdfs.FileId;
import com.jeesuite.filesystem.sdk.fdfs.FileMetadata;
import com.jeesuite.filesystem.sdk.fdfs.exchange.Requestor;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static com.jeesuite.filesystem.sdk.fdfs.FastdfsConstants.*;
import static com.jeesuite.filesystem.sdk.fdfs.FastdfsUtils.writeFixLength;
import static io.netty.util.CharsetUtil.UTF_8;
/**
* 设置文件属性请求
*
* @author liulongbiao
*/
public class FileMetadataSetEncoder implements Requestor.Encoder {
private final FileId fileId;
private final FileMetadata metadata;
private final byte flag;
/**
* @param fileId
* @param metadata
* @param flag
*/
public FileMetadataSetEncoder(FileId fileId, FileMetadata metadata, byte flag) {
this.fileId = Objects.requireNonNull(fileId);
this.metadata = metadata;
this.flag = flag;
}
@Override
public List