|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.fr.design.mainframe.share.util; |
|
|
|
|
|
|
|
|
|
import com.fr.base.theme.FormTheme; |
|
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.extra.PluginConstants; |
|
|
|
|
import com.fr.form.share.base.CancelCheck; |
|
|
|
@ -15,7 +14,6 @@ import com.fr.stable.StringUtils;
|
|
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
|
import com.fr.stable.xml.XMLReaderHelper; |
|
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
|
import com.fr.third.javax.xml.stream.XMLStreamException; |
|
|
|
|
import com.fr.third.org.apache.http.HttpEntity; |
|
|
|
|
import com.fr.third.org.apache.http.HttpException; |
|
|
|
|
import com.fr.third.org.apache.http.HttpStatus; |
|
|
|
@ -30,11 +28,12 @@ import com.fr.third.org.apache.http.impl.client.HttpClients;
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
import javax.crypto.Cipher; |
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.InputStreamReader; |
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
import java.security.KeyFactory; |
|
|
|
|
import java.security.interfaces.RSAPublicKey; |
|
|
|
@ -147,8 +146,16 @@ public class DownloadUtils {
|
|
|
|
|
} |
|
|
|
|
if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { |
|
|
|
|
HttpEntity entity = fileRes.getEntity(); |
|
|
|
|
InputStream content = entity.getContent(); |
|
|
|
|
XMLableReader reader = XMLReaderHelper.createXMLableReader(content, XMLPrintWriter.XML_ENCODER); |
|
|
|
|
|
|
|
|
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(entity.getContent())); |
|
|
|
|
StringBuilder stringBuilder = new StringBuilder(); |
|
|
|
|
String line; |
|
|
|
|
while ((line = bufferedReader.readLine()) != null) { |
|
|
|
|
stringBuilder.append(line); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String content = stringBuilder.toString(); |
|
|
|
|
XMLableReader reader = XMLReaderHelper.createXMLableReader(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)), XMLPrintWriter.XML_ENCODER); |
|
|
|
|
|
|
|
|
|
FormTheme theme = new FormTheme(); |
|
|
|
|
reader.readXMLObject(theme); |
|
|
|
|