1:修改证书策略中的crl字段的默认值为null
2:将redis存放文件时key的前缀提取到配置文件中方便后期修改
This commit is contained in:
@@ -13,14 +13,15 @@ import com.nis.restful.ServiceRuntimeException;
|
||||
import redis.clients.jedis.Transaction;
|
||||
|
||||
public class File2Redis {
|
||||
private static String fileProtocol = Configurations.getStringProperty("fileProtocol", "minio://");
|
||||
|
||||
public static String file2Redis(String url, Transaction transaction) {
|
||||
try {
|
||||
byte[] fileByte = downLoadFromUrl(url);
|
||||
String md5 = MD5Utils.getMd5ByIS(new ByteArrayInputStream(fileByte));
|
||||
String key = "redis://_FILE_" + md5;
|
||||
String key = "__FILE_" + md5;
|
||||
transaction.set(key.getBytes(), fileByte);
|
||||
return key;
|
||||
return fileProtocol + key;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceRuntimeException("保存文件到redis发生了异常:" + e.getMessage(),
|
||||
RestBusinessCode.SaveFileToRedisError.getValue());
|
||||
@@ -46,5 +47,4 @@ public class File2Redis {
|
||||
return baosOutputStream.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user