Search in sources :

Example 1 with FdfsUnsupportStorePathException

use of com.github.tobato.fastdfs.exception.FdfsUnsupportStorePathException in project oner365-cloud by xiaozhao32.

the class FileFdfsClient method deleteFile.

/**
 * 删除文件
 *
 * @param fileUrl 文件访问地址
 */
@Override
public Boolean deleteFile(String fileUrl) {
    if (DataUtils.isEmpty(fileUrl)) {
        return Boolean.FALSE;
    }
    try {
        StorePath storePath = StorePath.parseFromUrl(fileUrl);
        fastFileStorageClient.deleteFile(storePath.getGroup(), storePath.getPath());
        return fileStorageService.deleteById(fileUrl);
    } catch (FdfsUnsupportStorePathException e) {
        logger.error("delete File FdfsUnSupportStorePathException:", e);
    }
    return Boolean.FALSE;
}
Also used : StorePath(com.github.tobato.fastdfs.domain.fdfs.StorePath) FdfsUnsupportStorePathException(com.github.tobato.fastdfs.exception.FdfsUnsupportStorePathException)

Aggregations

StorePath (com.github.tobato.fastdfs.domain.fdfs.StorePath)1 FdfsUnsupportStorePathException (com.github.tobato.fastdfs.exception.FdfsUnsupportStorePathException)1