All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qiwenshare.ufop.operation.copy.product.FastDFSCopier Maven / Gradle / Ivy

There is a newer version: 1.3.4
Show newest version
package com.qiwenshare.ufop.operation.copy.product;

import com.github.tobato.fastdfs.domain.StorePath;
import com.github.tobato.fastdfs.service.AppendFileStorageClient;
import com.qiwenshare.ufop.operation.copy.Copier;
import com.qiwenshare.ufop.operation.copy.domain.CopyFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;

public class FastDFSCopier extends Copier {
    @Resource
    AppendFileStorageClient defaultAppendFileStorageClient;

    @Override
    public String copy(InputStream inputStream, CopyFile copyFile) {
        StorePath storePath = new StorePath();
        try {
            storePath = defaultAppendFileStorageClient.uploadAppenderFile("group1", inputStream,
                    inputStream.available(), copyFile.getExtendName());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return storePath.getPath();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy