Browse Source

移除过时的API调用

master
richie 4 years ago
parent
commit
9ef999e53c
  1. 1
      build.gradle
  2. BIN
      lib/dependence/aliyun-sdk-oss-3.3.0.jar
  3. BIN
      lib/dependence/jaxb-impl-2.2.3-1.jar
  4. BIN
      lib/dependence/jdom-1.1.jar
  5. BIN
      lib/dependence/jersey-core-1.9.jar
  6. BIN
      lib/dependence/jersey-json-1.9.jar
  7. 2
      plugin.xml
  8. 9
      src/main/java/com/fr/plugin/file/download/oss/OssFile2Image.java
  9. 7
      src/main/java/com/fr/plugin/file/submit/oss/fun/OssUpload.java
  10. 6
      src/main/java/com/fr/plugin/file/submit/oss/fun/OssUploadHttpHandler.java
  11. 7
      src/main/java/com/fr/plugin/file/submit/oss/job/OssSubmitJob.java

1
build.gradle

@ -117,6 +117,5 @@ repositories {
dependencies {
//使jar
implementation fileTree(dir: 'lib', include: ['**/*.jar'])
implementation fileTree(dir: libPath, include: ['**/*.jar'])
}

BIN
lib/dependence/aliyun-sdk-oss-3.3.0.jar

Binary file not shown.

BIN
lib/dependence/jaxb-impl-2.2.3-1.jar

Binary file not shown.

BIN
lib/dependence/jdom-1.1.jar

Binary file not shown.

BIN
lib/dependence/jersey-core-1.9.jar

Binary file not shown.

BIN
lib/dependence/jersey-json-1.9.jar

Binary file not shown.

2
plugin.xml

@ -2,7 +2,7 @@
<id>com.fr.plugin.file.submit.oss</id>
<name><![CDATA[OSS文件上传下载]]></name>
<active>yes</active>
<version>4.7.2</version>
<version>4.7.3</version>
<env-version>10.0</env-version>
<jartime>2019-06-13</jartime>
<vendor>author</vendor>

9
src/main/java/com/fr/plugin/file/download/oss/OssFile2Image.java

@ -1,13 +1,14 @@
package com.fr.plugin.file.download.oss;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.OSSObject;
import com.fanruan.api.log.LogKit;
import com.fanruan.api.util.ArrayKit;
import com.fanruan.api.util.GeneralKit;
import com.fanruan.api.util.IOKit;
import com.fanruan.api.log.LogKit;
import com.fr.plugin.oss.universal.config.OssUniversalConfig;
import com.fr.script.AbstractFunction;
import com.fanruan.api.util.ArrayKit;
import com.fr.stable.Primitive;
import javax.imageio.ImageIO;
@ -27,7 +28,7 @@ public class OssFile2Image extends AbstractFunction {
}
String key = GeneralKit.objectToString(args[0]);
String bucket = GeneralKit.objectToString(args[1]);
OSSClient ossClient = new OSSClient(
OSS ossClient = new OSSClientBuilder().build(
OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret());

7
src/main/java/com/fr/plugin/file/submit/oss/fun/OssUpload.java

@ -1,5 +1,6 @@
package com.fr.plugin.file.submit.oss.fun;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.fr.cache.Attachment;
import com.fr.general.FArray;
@ -14,7 +15,7 @@ import java.io.ByteArrayInputStream;
public class OssUpload {
public static void upload(Calculator calculator, OSSClient ossClient, OssSubmitTargetConfig submitTargetConfig)
public static void upload(Calculator calculator, OSS ossClient, OssSubmitTargetConfig submitTargetConfig)
throws Exception {
OssSubmitTarget[] submitTargets = submitTargetConfig.getSubmitTargets();
for (OssSubmitTarget target : submitTargets) {
@ -28,7 +29,7 @@ public class OssUpload {
}
}
private static void uploadFile(OSSClient ossClient, String bucket, Object file, String directory,
private static void uploadFile(OSS ossClient, String bucket, Object file, String directory,
String newFileName) {
if (file instanceof FRFile) {
uploadSingleFile(ossClient, bucket, directory, combineName(((FRFile) file).getFileName(), newFileName),
@ -50,7 +51,7 @@ public class OssUpload {
}
}
private static void uploadSingleFile(OSSClient ossClient, String bucket, String directory, String newFileName,
private static void uploadSingleFile(OSS ossClient, String bucket, String directory, String newFileName,
byte[] bytes) {
// if (ArrayUtils.isEmpty(bytes)) {
// throw new RuntimeException(I18nKit.getLocText("Plugin-File_Submit_Oss_Failed", newFileName));

6
src/main/java/com/fr/plugin/file/submit/oss/fun/OssUploadHttpHandler.java

@ -1,6 +1,8 @@
package com.fr.plugin.file.submit.oss.fun;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.fr.stable.script.NameSpace;
import com.fanruan.api.cal.ParameterKit;
import com.fanruan.api.net.NetworkKit;
@ -59,7 +61,7 @@ public class OssUploadHttpHandler extends BaseHttpHandler {
this.initCalAttrAndNS(calculator, reportSessionIDInfor, req);
boolean b = true;
final JSONObject jsonObject = JSONKit.create();
OSSClient ossClient = new OSSClient(
OSS ossClient = new OSSClientBuilder().build(
OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret());
@ -85,7 +87,7 @@ public class OssUploadHttpHandler extends BaseHttpHandler {
}
}
private void process(OSSClient ossClient, OssSubmitJavaScript javaScript, Calculator calculator) throws Exception {
private void process(OSS ossClient, OssSubmitJavaScript javaScript, Calculator calculator) throws Exception {
OssUpload.upload(calculator, ossClient, javaScript.getSubmitTargetConfig());
}

7
src/main/java/com/fr/plugin/file/submit/oss/job/OssSubmitJob.java

@ -1,6 +1,8 @@
package com.fr.plugin.file.submit.oss.job;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.fanruan.api.xml.XmlKit;
import com.fr.data.AbstractSubmitTask;
import com.fr.intelli.record.Focus;
@ -32,7 +34,7 @@ import java.util.Set;
@EnableMetrics
public class OssSubmitJob extends AbstractSubmitTask {
private OSSClient ossClient = null;
private OSS ossClient = null;
private OssSubmitTargetConfig submitTargetConfig;
@ -52,8 +54,7 @@ public class OssSubmitJob extends AbstractSubmitTask {
@Override
@Focus(id = "com.fr.plugin.file.submit.oss", text = "Plugin-File_Submit_OSS", source = Original.PLUGIN)
public void doJob(Calculator ca) throws Exception {
ossClient = new OSSClient(
OssUniversalConfig.getInstance().getEndPoint(),
ossClient = new OSSClientBuilder().build(OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret());
CalculatableResWorkSheet currentReport = ca.getAttribute(DMLReport.KEY);

Loading…
Cancel
Save