com.ionoscloud.s3.messages.PrefixConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ionos-cloud-sdk-s3 Show documentation
Show all versions of ionos-cloud-sdk-s3 Show documentation
IONOS Java SDK for Amazon S3 Compatible Cloud Storage
The newest version!
package com.ionoscloud.s3.messages;
import org.simpleframework.xml.convert.Converter;
import org.simpleframework.xml.stream.InputNode;
import org.simpleframework.xml.stream.OutputNode;
/**
* XML converter class for prefix due to SimpleXML limitation in converting empty tag
* to empty string.
*/
public class PrefixConverter implements Converter {
@Override
public String read(InputNode node) throws Exception {
String value = node.getValue();
return value != null ? value : "";
}
@Override
public void write(OutputNode node, String prefix) throws Exception {
node.setValue(prefix);
}
}