class FdfsTemplate {
    @Resource
    private FileServerProperties fileProperties;

    @Resource
    private FastFileStorageClient storageClient;

    @SneakyThrows
    public ObjectInfo upload(String objectName, InputStream is) {
        return upload(objectName, is, is.available());
    }

    @SneakyThrows
    public ObjectInfo upload(MultipartFile file) {
        return upload(file.getOriginalFilename(), file.getInputStream(), file.getSize());
    }

    /**
     * 上传对象
     * @param objectName 对象名
     * @param is 对象流
     * @param size 大小
     */
    private ObjectInfo upload(String objectName, InputStream is, long size) {
        StorePath storePath = storageClient.uploadFile(is, size, FilenameUtils.getExtension(objectName), null);
        ObjectInfo obj = new ObjectInfo();
        obj.setObjectPath(storePath.getFullPath());
        obj.setObjectUrl("http://" + fileProperties.getFdfs().getWebUrl() + "/" + storePath.getFullPath());
        return obj;
    }

    /**
     * 删除对象
     * @param objectPath 对象路径
     */
    public void delete(String objectPath) {
        if (!StringUtils.isEmpty(objectPath)) {
            StorePath storePath = StorePath.parseFromUrl(objectPath);
            storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
        }
    }

    /**
     * 下载对象
     * @param objectPath 对象路径
     * @param callback 回调
     */
    public <T> T download(String objectPath, DownloadCallback<T> callback) {<FILL_FUNCTION_BODY>}
}

        if (!StringUtils.isEmpty(objectPath)) {
            StorePath storePath = StorePath.parseFromUrl(objectPath);
            return storageClient.downloadFile(storePath.getGroup(), storePath.getPath(), callback);
        }
        return null;
    
<no_super_class>