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 { dependencies {
//使jar //使jar
implementation fileTree(dir: 'lib', include: ['**/*.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> <id>com.fr.plugin.file.submit.oss</id>
<name><![CDATA[OSS文件上传下载]]></name> <name><![CDATA[OSS文件上传下载]]></name>
<active>yes</active> <active>yes</active>
<version>4.7.2</version> <version>4.7.3</version>
<env-version>10.0</env-version> <env-version>10.0</env-version>
<jartime>2019-06-13</jartime> <jartime>2019-06-13</jartime>
<vendor>author</vendor> <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; 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.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.GeneralKit;
import com.fanruan.api.util.IOKit; import com.fanruan.api.util.IOKit;
import com.fanruan.api.log.LogKit;
import com.fr.plugin.oss.universal.config.OssUniversalConfig; import com.fr.plugin.oss.universal.config.OssUniversalConfig;
import com.fr.script.AbstractFunction; import com.fr.script.AbstractFunction;
import com.fanruan.api.util.ArrayKit;
import com.fr.stable.Primitive; import com.fr.stable.Primitive;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
@ -27,7 +28,7 @@ public class OssFile2Image extends AbstractFunction {
} }
String key = GeneralKit.objectToString(args[0]); String key = GeneralKit.objectToString(args[0]);
String bucket = GeneralKit.objectToString(args[1]); String bucket = GeneralKit.objectToString(args[1]);
OSSClient ossClient = new OSSClient( OSS ossClient = new OSSClientBuilder().build(
OssUniversalConfig.getInstance().getEndPoint(), OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(), OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret()); 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; package com.fr.plugin.file.submit.oss.fun;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient; import com.aliyun.oss.OSSClient;
import com.fr.cache.Attachment; import com.fr.cache.Attachment;
import com.fr.general.FArray; import com.fr.general.FArray;
@ -14,7 +15,7 @@ import java.io.ByteArrayInputStream;
public class OssUpload { 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 { throws Exception {
OssSubmitTarget[] submitTargets = submitTargetConfig.getSubmitTargets(); OssSubmitTarget[] submitTargets = submitTargetConfig.getSubmitTargets();
for (OssSubmitTarget target : submitTargets) { 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) { String newFileName) {
if (file instanceof FRFile) { if (file instanceof FRFile) {
uploadSingleFile(ossClient, bucket, directory, combineName(((FRFile) file).getFileName(), newFileName), 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) { byte[] bytes) {
// if (ArrayUtils.isEmpty(bytes)) { // if (ArrayUtils.isEmpty(bytes)) {
// throw new RuntimeException(I18nKit.getLocText("Plugin-File_Submit_Oss_Failed", newFileName)); // 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; package com.fr.plugin.file.submit.oss.fun;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient; import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.fr.stable.script.NameSpace; import com.fr.stable.script.NameSpace;
import com.fanruan.api.cal.ParameterKit; import com.fanruan.api.cal.ParameterKit;
import com.fanruan.api.net.NetworkKit; import com.fanruan.api.net.NetworkKit;
@ -59,7 +61,7 @@ public class OssUploadHttpHandler extends BaseHttpHandler {
this.initCalAttrAndNS(calculator, reportSessionIDInfor, req); this.initCalAttrAndNS(calculator, reportSessionIDInfor, req);
boolean b = true; boolean b = true;
final JSONObject jsonObject = JSONKit.create(); final JSONObject jsonObject = JSONKit.create();
OSSClient ossClient = new OSSClient( OSS ossClient = new OSSClientBuilder().build(
OssUniversalConfig.getInstance().getEndPoint(), OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(), OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret()); 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()); 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; package com.fr.plugin.file.submit.oss.job;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient; import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.fanruan.api.xml.XmlKit; import com.fanruan.api.xml.XmlKit;
import com.fr.data.AbstractSubmitTask; import com.fr.data.AbstractSubmitTask;
import com.fr.intelli.record.Focus; import com.fr.intelli.record.Focus;
@ -32,7 +34,7 @@ import java.util.Set;
@EnableMetrics @EnableMetrics
public class OssSubmitJob extends AbstractSubmitTask { public class OssSubmitJob extends AbstractSubmitTask {
private OSSClient ossClient = null; private OSS ossClient = null;
private OssSubmitTargetConfig submitTargetConfig; private OssSubmitTargetConfig submitTargetConfig;
@ -52,8 +54,7 @@ public class OssSubmitJob extends AbstractSubmitTask {
@Override @Override
@Focus(id = "com.fr.plugin.file.submit.oss", text = "Plugin-File_Submit_OSS", source = Original.PLUGIN) @Focus(id = "com.fr.plugin.file.submit.oss", text = "Plugin-File_Submit_OSS", source = Original.PLUGIN)
public void doJob(Calculator ca) throws Exception { public void doJob(Calculator ca) throws Exception {
ossClient = new OSSClient( ossClient = new OSSClientBuilder().build(OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getEndPoint(),
OssUniversalConfig.getInstance().getAccessKeyId(), OssUniversalConfig.getInstance().getAccessKeyId(),
OssUniversalConfig.getInstance().getRealAccessKeySecret()); OssUniversalConfig.getInstance().getRealAccessKeySecret());
CalculatableResWorkSheet currentReport = ca.getAttribute(DMLReport.KEY); CalculatableResWorkSheet currentReport = ca.getAttribute(DMLReport.KEY);

Loading…
Cancel
Save