文件可上传至阿里云OSS中,也可以从OSS中下载文件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

115 lines
3.5 KiB

package com.fr.plugin.file.submit.oss.fun;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
public class OssSubmitTarget implements XMLable {
public static final String XML_TAG = "OssSubmitTarget";
private String bucket;
private OssVariableValue directory;
private OssVariableValue file;
private OssVariableValue name;
public OssSubmitTarget() {
}
public OssSubmitTarget(final String bucket, final OssVariableValue directory, final OssVariableValue file, final OssVariableValue name) {
this.bucket = bucket;
this.directory = directory;
this.file = file;
this.name = name;
}
public String getBucket() {
return this.bucket;
}
public void setBucket(final String bucket) {
this.bucket = bucket;
}
public OssVariableValue getDirectory() {
return directory;
}
public void setDirectory(OssVariableValue directory) {
this.directory = directory;
}
public OssVariableValue getName() {
return this.name;
}
public void setName(final OssVariableValue name) {
this.name = name;
}
public OssVariableValue getFile() {
return this.file;
}
public void setFile(final OssVariableValue file) {
this.file = file;
}
public void readXML(final XMLableReader reader) {
if (reader.isChildNode()) {
String tagName = reader.getTagName();
if ("Bucket".equals(tagName)) {
this.bucket = reader.getElementValue();
} else if ("Directory".equals(tagName)) {
this.directory = (OssVariableValue) GeneralXMLTools.readXMLable(reader);
} else if ("Name".equals(tagName)) {
this.name = (OssVariableValue) GeneralXMLTools.readXMLable(reader);
} else if ("File".equals(tagName)) {
this.file = (OssVariableValue) GeneralXMLTools.readXMLable(reader);
}
}
}
public void writeXML(final XMLPrintWriter writer) {
if (StringUtils.isNotEmpty(bucket)) {
writer.startTAG("Bucket").textNode(bucket).end();
}
if (directory != null) {
GeneralXMLTools.writeXMLable(writer, directory, "Directory");
}
if (name != null) {
GeneralXMLTools.writeXMLable(writer, name, "Name");
}
if (file != null) {
GeneralXMLTools.writeXMLable(writer, file, "File");
}
}
@Override
public boolean equals(final Object o) {
return o instanceof OssSubmitTarget
&& AssistUtils.equals(((OssSubmitTarget) o).bucket, bucket)
&& AssistUtils.equals(((OssSubmitTarget) o).directory, directory)
&& AssistUtils.equals(((OssSubmitTarget) o).name, name)
&& AssistUtils.equals(((OssSubmitTarget) o).file, file);
}
public Object clone() throws CloneNotSupportedException {
OssSubmitTarget cloned = (OssSubmitTarget) super.clone();
cloned.bucket = bucket;
if (directory != null) {
cloned.directory = (OssVariableValue) directory.clone();
}
if (name != null) {
cloned.name = (OssVariableValue) name.clone();
}
if (file != null) {
cloned.file = (OssVariableValue) file.clone();
}
return cloned;
}
}