You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/02/14 09:49:38 UTC
[33/51] [partial] cxf git commit: Remove all trailing whitespaces
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
index 05f19a9..c9330b9 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java
@@ -89,10 +89,10 @@ public final class EndpointReferenceUtils {
/**
* We want to load the schemas, including references to external schemas, into a SchemaFactory
- * to validate. There seem to be bugs in resolving inter-schema references in Xerces, so even when we are
+ * to validate. There seem to be bugs in resolving inter-schema references in Xerces, so even when we are
* handing the factory all the schemas, interrelated with <import> elements, we need
* to also hand over extra copies (!) as character images when requested.
- *
+ *
* To do this, we use the DOM representation kept in the SchemaInfo. This has the bonus
* of benefiting from the use of the catalog resolver in there, which is missing from
* the code in here.
@@ -102,12 +102,12 @@ public final class EndpointReferenceUtils {
private final Set<String> done = new HashSet<>();
private final ExtendedURIResolver resolver = new ExtendedURIResolver();
private final Bus bus;
-
+
private SchemaLSResourceResolver(Map<String, byte[]> schemas, Bus b) {
this.schemas = schemas;
this.bus = b;
}
-
+
public LSInput resolveResource(String type, String namespaceURI, String publicId,
String systemId, String baseURI) {
@@ -134,15 +134,15 @@ public final class EndpointReferenceUtils {
if (done.contains(newId + ":" + namespaceURI)) {
return null;
}
-
+
if (schemas.containsKey(newId + ":" + namespaceURI)) {
byte[] ds = schemas.remove(newId + ":" + namespaceURI);
- impl = createInput(newId, ds);
+ impl = createInput(newId, ds);
done.add(newId + ":" + namespaceURI);
}
if (impl == null && schemas.containsKey(newId + ":null")) {
byte[] ds = schemas.get(newId + ":null");
- impl = createInput(newId, ds);
+ impl = createInput(newId, ds);
done.add(newId + ":" + namespaceURI);
}
if (impl == null && bus != null && systemId != null) {
@@ -170,7 +170,7 @@ public final class EndpointReferenceUtils {
}
}
// there can be multiple includes on the same namespace. This scenario is not envisioned yet.
- // hence the filename part is included as well.
+ // hence the filename part is included as well.
if (systemId != null) {
String systemIdFileName = systemId.substring(systemId.lastIndexOf('/') + 1);
for (Map.Entry<String, byte[]> ent : schemas.entrySet()) {
@@ -195,7 +195,7 @@ public final class EndpointReferenceUtils {
}
}
}
-
+
//REVIST - we need to get catalogs in here somehow :-(
if (systemId == null) {
systemId = publicId;
@@ -223,15 +223,15 @@ public final class EndpointReferenceUtils {
}
public static final String ANONYMOUS_ADDRESS = "http://www.w3.org/2005/08/addressing/anonymous";
-
+
private static final Logger LOG = LogUtils.getL7dLogger(EndpointReferenceUtils.class);
private static final String NS_WSAW_2005 = "http://www.w3.org/2005/02/addressing/wsdl";
- private static final String WSDL_INSTANCE_NAMESPACE2 =
+ private static final String WSDL_INSTANCE_NAMESPACE2 =
"http://www.w3.org/2006/01/wsdl-instance";
- private static final String WSDL_INSTANCE_NAMESPACE =
+ private static final String WSDL_INSTANCE_NAMESPACE =
"http://www.w3.org/ns/wsdl-instance";
-
+
private static final QName WSA_WSDL_NAMESPACE_NS =
new QName("xmlns:" + JAXWSAConstants.WSAW_PREFIX);
private static final String XML_SCHEMA_NAMESPACE =
@@ -245,15 +245,15 @@ public final class EndpointReferenceUtils {
new QName(WSDL_INSTANCE_NAMESPACE2, "wsdlLocation");
private static final QName WSDL_LOCATION =
new QName(WSDL_INSTANCE_NAMESPACE, "wsdlLocation");
- private static final QName XSI_TYPE =
+ private static final QName XSI_TYPE =
new QName(XML_SCHEMA_INSTANCE_NAMESPACE, "type", "xsi");
-
- private static final org.apache.cxf.ws.addressing.wsdl.ObjectFactory WSA_WSDL_OBJECT_FACTORY =
+
+ private static final org.apache.cxf.ws.addressing.wsdl.ObjectFactory WSA_WSDL_OBJECT_FACTORY =
new org.apache.cxf.ws.addressing.wsdl.ObjectFactory();
-
-
+
+
private static final Set<Class<?>> ADDRESSING_CLASSES = new HashSet<Class<?>>();
- private static final AtomicReference<Reference<JAXBContext>> ADDRESSING_CONTEXT
+ private static final AtomicReference<Reference<JAXBContext>> ADDRESSING_CONTEXT
= new AtomicReference<Reference<JAXBContext>>(new SoftReference<JAXBContext>(null));
static {
ADDRESSING_CLASSES.add(WSA_WSDL_OBJECT_FACTORY.getClass());
@@ -263,15 +263,15 @@ public final class EndpointReferenceUtils {
private EndpointReferenceUtils() {
// Utility class - never constructed
}
-
+
/**
- * Sets the service and port name of the provided endpoint reference.
+ * Sets the service and port name of the provided endpoint reference.
* @param ref the endpoint reference.
* @param serviceName the name of service.
* @param portName the port name.
*/
- public static void setServiceAndPortName(EndpointReferenceType ref,
- QName serviceName,
+ public static void setServiceAndPortName(EndpointReferenceType ref,
+ QName serviceName,
String portName) {
if (null != serviceName) {
JAXBElement<ServiceNameType> jaxbElement = getServiceNameType(serviceName, portName);
@@ -280,8 +280,8 @@ public final class EndpointReferenceUtils {
mt.getAny().add(jaxbElement);
}
}
-
-
+
+
public static MetadataType getSetMetadata(EndpointReferenceType ref) {
MetadataType mt = ref.getMetadata();
if (null == mt) {
@@ -290,20 +290,20 @@ public final class EndpointReferenceUtils {
}
return mt;
}
-
+
public static JAXBElement<ServiceNameType> getServiceNameType(QName serviceName, String portName) {
ServiceNameType serviceNameType = WSA_WSDL_OBJECT_FACTORY.createServiceNameType();
serviceNameType.setValue(serviceName);
serviceNameType.setEndpointName(portName);
serviceNameType.getOtherAttributes().put(WSA_WSDL_NAMESPACE_NS, JAXWSAConstants.NS_WSAW);
- serviceNameType.getOtherAttributes().put(XSI_TYPE,
- JAXWSAConstants.WSAW_PREFIX + ":"
+ serviceNameType.getOtherAttributes().put(XSI_TYPE,
+ JAXWSAConstants.WSAW_PREFIX + ":"
+ serviceNameType.getClass().getSimpleName());
return WSA_WSDL_OBJECT_FACTORY.createServiceName(serviceNameType);
}
-
+
/**
- * Gets the service name of the provided endpoint reference.
+ * Gets the service name of the provided endpoint reference.
* @param ref the endpoint reference.
* @return the service name.
*/
@@ -329,7 +329,7 @@ public final class EndpointReferenceUtils {
Node nodeAttr = node.getAttributes().getNamedItem("xmlns");
namespaceURI = nodeAttr.getNodeValue();
}
-
+
return new QName(namespaceURI, service);
}
} else if (obj instanceof JAXBElement) {
@@ -343,7 +343,7 @@ public final class EndpointReferenceUtils {
}
return null;
}
-
+
/**
* Gets the port name of the provided endpoint reference.
* @param ref the endpoint reference.
@@ -374,12 +374,12 @@ public final class EndpointReferenceUtils {
}
return null;
}
-
+
public static QName getPortQName(EndpointReferenceType ref, Bus bus) {
- QName serviceName = getServiceName(ref, bus);
+ QName serviceName = getServiceName(ref, bus);
return new QName(serviceName.getNamespaceURI(), getPortName(ref));
}
-
+
public static void setPortName(EndpointReferenceType ref, String portName) {
MetadataType metadata = ref.getMetadata();
if (metadata != null) {
@@ -403,27 +403,27 @@ public final class EndpointReferenceUtils {
}
}
}
-
+
public static void setInterfaceName(EndpointReferenceType ref, QName portTypeName) {
if (null != portTypeName) {
AttributedQNameType interfaceNameType =
WSA_WSDL_OBJECT_FACTORY.createAttributedQNameType();
-
+
interfaceNameType.setValue(portTypeName);
- interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS,
+ interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS,
XML_SCHEMA_NAMESPACE);
interfaceNameType.getOtherAttributes().put(XSI_TYPE,
XML_SCHEMA_NAMESPACE_PREFIX + ":"
+ portTypeName.getClass().getSimpleName());
-
- JAXBElement<AttributedQNameType> jaxbElement =
+
+ JAXBElement<AttributedQNameType> jaxbElement =
WSA_WSDL_OBJECT_FACTORY.createInterfaceName(interfaceNameType);
MetadataType mt = getSetMetadata(ref);
mt.getAny().add(jaxbElement);
}
}
-
+
public static QName getInterfaceName(EndpointReferenceType ref, Bus bus) {
MetadataType metadata = ref.getMetadata();
if (metadata == null) {
@@ -435,7 +435,7 @@ public final class EndpointReferenceUtils {
if ((node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW)
|| node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM))
&& node.getNodeName().contains("InterfaceName")) {
-
+
String content = node.getTextContent();
String namespaceURI = node.getFirstChild().getNamespaceURI();
//String service = content;
@@ -461,9 +461,9 @@ public final class EndpointReferenceUtils {
return null;
}
-
+
public static void setWSDLLocation(EndpointReferenceType ref, String... wsdlLocation) {
-
+
MetadataType metadata = getSetMetadata(ref);
//wsdlLocation attribute is a list of anyURI.
@@ -475,7 +475,7 @@ public final class EndpointReferenceUtils {
metadata.getOtherAttributes().put(WSDL_LOCATION, strBuf.toString().trim());
}
-
+
public static String getWSDLLocation(EndpointReferenceType ref) {
String wsdlLocation = null;
MetadataType metadata = ref.getMetadata();
@@ -491,7 +491,7 @@ public final class EndpointReferenceUtils {
return null;
}
- //TODO The wsdlLocation inserted should be a valid URI
+ //TODO The wsdlLocation inserted should be a valid URI
//before doing a split. So temporarily return the string
//return wsdlLocation.split(" ");
return wsdlLocation;
@@ -504,7 +504,7 @@ public final class EndpointReferenceUtils {
*/
public static void setMetadata(EndpointReferenceType ref, List<Source> metadata)
throws EndpointUtilsException {
-
+
if (null != ref) {
MetadataType mt = getSetMetadata(ref);
List<Object> anyList = mt.getAny();
@@ -522,16 +522,16 @@ public final class EndpointReferenceUtils {
} else if (source instanceof DOMSource) {
node = ((DOMSource)source).getNode();
doTransform = false;
- }
-
+ }
+
if (doTransform) {
DOMResult domResult = new DOMResult();
domResult.setSystemId(source.getSystemId());
node = StaxUtils.read(source);
-
+
node = domResult.getNode();
}
-
+
if (null != node) {
if (node instanceof Document) {
try {
@@ -541,11 +541,11 @@ public final class EndpointReferenceUtils {
}
node = node.getFirstChild();
}
-
+
while (node.getNodeType() != Node.ELEMENT_NODE) {
node = node.getNextSibling();
}
-
+
anyList.add(node);
}
}
@@ -555,8 +555,8 @@ public final class EndpointReferenceUtils {
}
}
}
-
-
+
+
private static synchronized Schema createSchema(ServiceInfo serviceInfo, Bus b) {
if (b == null) {
b = BusFactory.getThreadDefaultBus(false);
@@ -581,7 +581,7 @@ public final class EndpointReferenceUtils {
if (baseURI == null) {
baseURI = si.getSystemId();
}
- DOMSource ds = new DOMSource(el, baseURI);
+ DOMSource ds = new DOMSource(el, baseURI);
schemaSourcesMap2.put(si.getSystemId() + ":" + si.getNamespaceURI(), ds);
LoadingByteArrayOutputStream out = new LoadingByteArrayOutputStream();
writer = StaxUtils.createXMLStreamWriter(out);
@@ -590,12 +590,12 @@ public final class EndpointReferenceUtils {
schemaSourcesMap.put(si.getSystemId() + ":" + si.getNamespaceURI(), out.toByteArray());
}
-
+
for (XmlSchema sch : serviceInfo.getXmlSchemaCollection().getXmlSchemas()) {
if (sch.getSourceURI() != null
- && !schemaSourcesMap.containsKey(sch.getSourceURI() + ":"
- + sch.getTargetNamespace())) {
-
+ && !schemaSourcesMap.containsKey(sch.getSourceURI() + ":"
+ + sch.getTargetNamespace())) {
+
InputStream ins = null;
try {
URL url = new URL(sch.getSourceURI());
@@ -604,7 +604,7 @@ public final class EndpointReferenceUtils {
//ignore, we'll just use what we have. (though
//bugs in XmlSchema could make this less useful)
}
-
+
LoadingByteArrayOutputStream out = new LoadingByteArrayOutputStream();
if (ins == null) {
sch.write(out);
@@ -612,21 +612,21 @@ public final class EndpointReferenceUtils {
IOUtils.copyAndCloseInput(ins, out);
}
- schemaSourcesMap.put(sch.getSourceURI() + ":"
+ schemaSourcesMap.put(sch.getSourceURI() + ":"
+ sch.getTargetNamespace(), out.toByteArray());
-
+
Source source = new StreamSource(out.createInputStream(), sch.getSourceURI());
- schemaSourcesMap2.put(sch.getSourceURI() + ":"
+ schemaSourcesMap2.put(sch.getSourceURI() + ":"
+ sch.getTargetNamespace(), source);
}
- }
+ }
factory.setResourceResolver(new SchemaLSResourceResolver(schemaSourcesMap, b));
schema = factory.newSchema(schemaSourcesMap2.values()
.toArray(new Source[schemaSourcesMap2.size()]));
-
-
+
+
} catch (Exception ex) {
// Something not right with the schema from the wsdl.
LOG.log(Level.WARNING, "SAXException for newSchema()", ex);
@@ -634,7 +634,7 @@ public final class EndpointReferenceUtils {
String s = StaxUtils.toString(schemaInfo.getElement(), 4);
LOG.log(Level.INFO, "Schema for: " + schemaInfo.getNamespaceURI() + "\n" + s);
}
- } finally {
+ } finally {
for (Source src : schemaSourcesMap2.values()) {
if (src instanceof DOMSource) {
Node nd = ((DOMSource)src).getNode();
@@ -647,7 +647,7 @@ public final class EndpointReferenceUtils {
}
return schema;
}
-
+
private static void unsetReadonly(Node nd) {
try {
//work around a bug in the version of Xerces that is in the JDK
@@ -677,7 +677,7 @@ public final class EndpointReferenceUtils {
}
return schema;
}
-
+
/**
* Get the address from the provided endpoint reference.
@@ -709,7 +709,7 @@ public final class EndpointReferenceUtils {
* @param portName - the name of the port.
* @return EndpointReferenceType - the endpoint reference
*/
- public static EndpointReferenceType getEndpointReference(URL wsdlUrl,
+ public static EndpointReferenceType getEndpointReference(URL wsdlUrl,
QName serviceName,
String portName) {
EndpointReferenceType reference = new EndpointReferenceType();
@@ -720,8 +720,8 @@ public final class EndpointReferenceUtils {
return reference;
}
-
-
+
+
/**
* Create a duplicate endpoint reference sharing all atributes
* @param ref the reference to duplicate
@@ -734,7 +734,7 @@ public final class EndpointReferenceUtils {
reference.setAddress(ref.getAddress());
return reference;
}
-
+
/**
* Create an endpoint reference for the provided address.
* @param address - address URI
@@ -745,13 +745,13 @@ public final class EndpointReferenceUtils {
setAddress(reference, address);
return reference;
}
-
+
public static EndpointReferenceType getEndpointReference(AttributedURIType address) {
EndpointReferenceType reference = new EndpointReferenceType();
reference.setAddress(address);
return reference;
- }
-
+ }
+
/**
* Create an anonymous endpoint reference.
* @return EndpointReferenceType - the endpoint reference
@@ -761,10 +761,10 @@ public final class EndpointReferenceUtils {
setAddress(reference, ANONYMOUS_ADDRESS);
return reference;
}
-
+
/**
* Resolve logical endpoint reference via the Bus EndpointResolverRegistry.
- *
+ *
* @param logical the abstract EPR to resolve
* @return the resolved concrete EPR if appropriate, null otherwise
*/
@@ -780,10 +780,10 @@ public final class EndpointReferenceUtils {
return physical != null ? physical : logical;
}
-
+
/**
* Renew logical endpoint reference via the Bus EndpointResolverRegistry.
- *
+ *
* @param logical the original abstract EPR (if still available)
* @param physical the concrete EPR to renew
* @return the renewed concrete EPR if appropriate, null otherwise
@@ -804,7 +804,7 @@ public final class EndpointReferenceUtils {
/**
* Mint logical endpoint reference via the Bus EndpointResolverRegistry.
- *
+ *
* @param serviceName the given serviceName
* @return the newly minted EPR if appropriate, null otherwise
*/
@@ -819,11 +819,11 @@ public final class EndpointReferenceUtils {
}
return logical;
}
-
+
/**
* Mint logical endpoint reference via the Bus EndpointResolverRegistry.
- *
- * @param physical the concrete template EPR
+ *
+ * @param physical the concrete template EPR
* @return the newly minted EPR if appropriate, null otherwise
*/
public static EndpointReferenceType mint(EndpointReferenceType physical, Bus bus) {
@@ -837,10 +837,10 @@ public final class EndpointReferenceUtils {
}
return logical != null ? logical : physical;
}
-
+
private static String getNameSpaceUri(Node node, String content, String namespaceURI) {
if (namespaceURI == null) {
- namespaceURI = node.lookupNamespaceURI(content.substring(0,
+ namespaceURI = node.lookupNamespaceURI(content.substring(0,
content.indexOf(":")));
}
return namespaceURI;
@@ -856,23 +856,23 @@ public final class EndpointReferenceUtils {
* @param portName identifies a particular port of the service, may be null
* @param id that must be embedded in the returned reference
* @param bus the current bus
- * @return a new reference or null if the target destination does not support destination mutiplexing
+ * @return a new reference or null if the target destination does not support destination mutiplexing
*/
- public static EndpointReferenceType getEndpointReferenceWithId(QName serviceQName,
- String portName,
- String id,
+ public static EndpointReferenceType getEndpointReferenceWithId(QName serviceQName,
+ String portName,
+ String id,
Bus bus) {
- EndpointReferenceType epr = null;
+ EndpointReferenceType epr = null;
MultiplexDestination destination = getMatchingMultiplexDestination(serviceQName, portName, bus);
if (null != destination) {
epr = destination.getAddressWithId(id);
}
return epr;
}
-
+
/**
- * Obtain the id String from the endpoint reference of the current dispatch.
- * @param messageContext the current message context
+ * Obtain the id String from the endpoint reference of the current dispatch.
+ * @param messageContext the current message context
* @return the id embedded in the current endpoint reference or null if not found
*/
public static String getEndpointReferenceId(Map<String, Object> messageContext) {
@@ -883,7 +883,7 @@ public final class EndpointReferenceUtils {
}
return id;
}
-
+
private static synchronized JAXBContext createContextForEPR() throws JAXBException {
Reference<JAXBContext> rctx = ADDRESSING_CONTEXT.get();
@@ -893,7 +893,7 @@ public final class EndpointReferenceUtils {
null, null, null,
true).getContext();
ADDRESSING_CONTEXT.set(new SoftReference<JAXBContext>(ctx));
- }
+ }
return ctx;
}
private static JAXBContext getJAXBContextForEPR() throws JAXBException {
@@ -911,18 +911,18 @@ public final class EndpointReferenceUtils {
QName qname = new QName("http://www.w3.org/2005/08/addressing", "EndpointReference");
JAXBElement<EndpointReferenceType> jaxEle
= new JAXBElement<EndpointReferenceType>(qname, EndpointReferenceType.class, epr);
-
-
+
+
W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
- jm.marshal(jaxEle, writer);
+ jm.marshal(jaxEle, writer);
return new DOMSource(writer.getDocument());
} catch (JAXBException e) {
//ignore
}
return null;
}
-
-
+
+
private static MultiplexDestination getMatchingMultiplexDestination(QName serviceQName, String portName,
Bus bus) {
MultiplexDestination destination = null;
@@ -941,7 +941,7 @@ public final class EndpointReferenceUtils {
}
} else {
LOG.log(Level.WARNING,
- "Failed to locate service matching " + serviceQName
+ "Failed to locate service matching " + serviceQName
+ ", because the bus ServerRegistry extension provider is null");
}
return destination;
@@ -949,13 +949,13 @@ public final class EndpointReferenceUtils {
private static boolean portNameMatches(Server s, String portName) {
boolean ret = false;
- if (null == portName
+ if (null == portName
|| portName.equals(s.getEndpoint().getEndpointInfo().getName().getLocalPart())) {
return true;
}
return ret;
}
-
-
-
+
+
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/EndpointUtilsException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointUtilsException.java b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointUtilsException.java
index 4279b4d..1f4a194 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/EndpointUtilsException.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/EndpointUtilsException.java
@@ -27,7 +27,7 @@ public class EndpointUtilsException extends Exception {
public EndpointUtilsException(Message msg) {
super(msg);
}
-
+
public EndpointUtilsException(Message msg, Throwable t) {
super(msg, t);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java b/core/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
index bb7e5d3..db85ab7 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/JAXWSAConstants.java
@@ -27,7 +27,7 @@ import javax.xml.namespace.QName;
* A container for WS-Addressing constants.
*/
public final class JAXWSAConstants {
-
+
public static final String WSAW_PREFIX = "wsaw";
public static final String NS_WSAW = "http://www.w3.org/2006/05/addressing/wsdl";
public static final String WSAM_PREFIX = "wsam";
@@ -35,9 +35,9 @@ public final class JAXWSAConstants {
public static final QName WSAW_ACTION_QNAME = new QName(NS_WSAW, "Action");
public static final QName WSAM_ACTION_QNAME = new QName(NS_WSAM, "Action");
-
+
public static final QName WSAW_USINGADDRESSING_QNAME = new QName(NS_WSAW, "UsingAddressing");
-
+
public static final String NS_WSA = "http://www.w3.org/2005/08/addressing";
public static final String WSA_PREFIX = "wsa";
public static final String WSA_XSD = "http://www.w3.org/2006/03/addressing/ws-addr.xsd";
@@ -45,10 +45,10 @@ public final class JAXWSAConstants {
public static final String WSA_REFERENCEPARAMETERS_NAME = "ReferenceParameters";
public static final String WSA_METADATA_NAME = "Metadata";
public static final String WSA_ADDRESS_NAME = "Address";
-
+
public static final String WSAM_SERVICENAME_NAME = "ServiceName";
public static final String WSAM_INTERFACE_NAME = "InterfaceName";
- public static final String WSAM_ENDPOINT_NAME = "EndpointName";
+ public static final String WSAM_ENDPOINT_NAME = "EndpointName";
public static final String WSDLI_PFX = "wsdli";
@@ -59,16 +59,16 @@ public final class JAXWSAConstants {
* Well-known Property names for AddressingProperties in BindingProvider
* Context.
*/
- public static final String CLIENT_ADDRESSING_PROPERTIES =
+ public static final String CLIENT_ADDRESSING_PROPERTIES =
"javax.xml.ws.addressing.context";
-
+
/**
* Well-known Property names for AddressingProperties in Handler
* Context.
*/
- public static final String ADDRESSING_PROPERTIES_INBOUND =
+ public static final String ADDRESSING_PROPERTIES_INBOUND =
"javax.xml.ws.addressing.context.inbound";
- public static final String ADDRESSING_PROPERTIES_OUTBOUND =
+ public static final String ADDRESSING_PROPERTIES_OUTBOUND =
"javax.xml.ws.addressing.context.outbound";
@@ -81,9 +81,9 @@ public final class JAXWSAConstants {
@Deprecated
public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = ADDRESSING_PROPERTIES_OUTBOUND;
-
+
/**
- * Prevents instantiation.
+ * Prevents instantiation.
*/
private JAXWSAConstants() {
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java b/core/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
index 7687785..721ea60 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
@@ -27,16 +27,16 @@ import org.apache.cxf.phase.Phase;
import org.apache.cxf.phase.PhaseInterceptor;
/**
- * Logical Handler responsible for aggregating the Message Addressing
+ * Logical Handler responsible for aggregating the Message Addressing
* Properties for outgoing messages.
*/
public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
public static final String USING_ADDRESSING = MAPAggregator.class.getName() + ".usingAddressing";
public static final String ADDRESSING_DISABLED = MAPAggregator.class.getName() + ".addressingDisabled";
- public static final String DECOUPLED_DESTINATION = MAPAggregator.class.getName()
+ public static final String DECOUPLED_DESTINATION = MAPAggregator.class.getName()
+ ".decoupledDestination";
public static final String ACTION_VERIFIED = MAPAggregator.class.getName() + ".actionVerified";
-
+
public interface MAPAggregatorLoader {
MAPAggregator createImplementation(MAPAggregator mag);
}
@@ -45,7 +45,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
protected boolean usingAddressingAdvisory = true;
protected boolean addressingRequired;
protected boolean allowDuplicates = true;
- protected WSAddressingFeature.AddressingResponses addressingResponses
+ protected WSAddressingFeature.AddressingResponses addressingResponses
= WSAddressingFeature.AddressingResponses.ALL;
/**
@@ -60,7 +60,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
super(MAPAggregator.class.getName(), Phase.PRE_LOGICAL);
addBefore("org.apache.cxf.interceptor.OneWayProcessorInterceptor");
}
-
+
/**
* Indicates if duplicate messageIDs are allowed.
* @return true if duplicate messageIDs are allowed
@@ -73,7 +73,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
/**
- * Allows/disallows duplicate messageIdDs.
+ * Allows/disallows duplicate messageIdDs.
* @param ad whether duplicate messageIDs are allowed
*/
public void setAllowDuplicates(boolean ad) {
@@ -88,7 +88,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
* in the WSDL is purely advisory, i.e. its absence doesn't prevent
* the encoding of WS-A headers.
*
- * @return true if the presence of the <wsaw:UsingAddressing> element is
+ * @return true if the presence of the <wsaw:UsingAddressing> element is
* advisory
*/
public boolean isUsingAddressingAdvisory() {
@@ -112,7 +112,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
usingAddressingAdvisory = advisory;
}
-
+
/**
* Whether the use of addressing is completely required for this endpoint
*
@@ -134,9 +134,9 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
addressingRequired = required;
}
-
+
/**
- * Sets Addresing Response
+ * Sets Addresing Response
*
*/
public void setAddressingResponses(WSAddressingFeature.AddressingResponses responses) {
@@ -145,7 +145,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
addressingResponses = responses;
}
-
+
/**
* Returns the cache used to enforce duplicate message IDs when
* {@link #allowDuplicates()} returns {@code false}.
@@ -176,9 +176,9 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
this.messageIdCache = messageIdCache;
}
-
+
/**
- * Sets Addressing Response
+ * Sets Addressing Response
*
*/
public WSAddressingFeature.AddressingResponses getAddressingResponses() {
@@ -187,7 +187,7 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
return addressingResponses;
}
-
+
/**
* Invoked for normal processing of inbound and outbound messages.
*
@@ -202,20 +202,20 @@ public class MAPAggregator extends AbstractPhaseInterceptor<Message> {
}
impl.handleMessage(message);
}
-
+
public void handleFault(Message message) {
if (impl != null) {
impl.handleFault(message);
}
}
-
-
+
+
public Collection<PhaseInterceptor<? extends Message>> getAdditionalInterceptors() {
if (impl != null) {
return impl.getAdditionalInterceptors();
}
return super.getAdditionalInterceptors();
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/MessageIdCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/MessageIdCache.java b/core/src/main/java/org/apache/cxf/ws/addressing/MessageIdCache.java
index 9c912dc..659cc2d 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/MessageIdCache.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/MessageIdCache.java
@@ -22,12 +22,12 @@ package org.apache.cxf.ws.addressing;
* Interface abstracting various ID caches for enforcement of ID uniqueness.
*/
public interface MessageIdCache {
-
+
/**
* Check {@code messageId} for uniqueness against previously
* encountered values and cache the ID. Note that the retention
* policy for previously encountered values is implementation specific.
- *
+ *
* @param messageId the message ID to check for uniqueness and cache for
* future comparison
*
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/Names.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/Names.java b/core/src/main/java/org/apache/cxf/ws/addressing/Names.java
index c0761a1..4f4a60c 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/Names.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/Names.java
@@ -30,78 +30,78 @@ import javax.xml.namespace.QName;
* Holder for WS-Addressing names (of headers, namespaces etc.).
*/
public final class Names {
-
- public static final String WSA_NAMESPACE_NAME =
+
+ public static final String WSA_NAMESPACE_NAME =
"http://www.w3.org/2005/08/addressing";
-
+
public static final String WSA_NAMESPACE_WSDL_NAME = "http://www.w3.org/2006/05/addressing/wsdl";
- public static final String WSA_NAMESPACE_WSDL_NAME_OLD =
+ public static final String WSA_NAMESPACE_WSDL_NAME_OLD =
"http://www.w3.org/2005/02/addressing/wsdl";
- public static final String WSA_NAMESPACE_WSDL_METADATA =
+ public static final String WSA_NAMESPACE_WSDL_METADATA =
"http://www.w3.org/2007/05/addressing/metadata";
public static final String WSA_NAMESPACE_PATTERN = "/addressing";
- public static final String WSA_REFERENCE_PARAMETERS_NAME =
+ public static final String WSA_REFERENCE_PARAMETERS_NAME =
"ReferenceParameters";
- public static final QName WSA_REFERENCE_PARAMETERS_QNAME =
+ public static final QName WSA_REFERENCE_PARAMETERS_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_REFERENCE_PARAMETERS_NAME);
-
- public static final String WSA_IS_REFERENCE_PARAMETER_NAME =
+
+ public static final String WSA_IS_REFERENCE_PARAMETER_NAME =
"IsReferenceParameter";
public static final QName WSA_IS_REFERENCE_PARAMETER_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_IS_REFERENCE_PARAMETER_NAME);
-
+
public static final String WSA_ADDRESS_NAME = "Address";
- public static final QName WSA_ADDRESS_QNAME =
+ public static final QName WSA_ADDRESS_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_ADDRESS_NAME);
-
+
public static final String WSA_METADATA_NAME = "Metadata";
- public static final QName WSA_METADATA_QNAME =
+ public static final QName WSA_METADATA_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_METADATA_NAME);
-
+
public static final String WSA_FROM_NAME = "From";
- public static final QName WSA_FROM_QNAME =
+ public static final QName WSA_FROM_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_FROM_NAME);
public static final String WSA_TO_NAME = "To";
- public static final QName WSA_TO_QNAME =
+ public static final QName WSA_TO_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_TO_NAME);
-
+
public static final String WSA_REPLYTO_NAME = "ReplyTo";
- public static final QName WSA_REPLYTO_QNAME =
+ public static final QName WSA_REPLYTO_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_REPLYTO_NAME);
public static final String WSA_FAULTTO_NAME = "FaultTo";
- public static final QName WSA_FAULTTO_QNAME =
+ public static final QName WSA_FAULTTO_QNAME =
new QName(WSA_NAMESPACE_NAME, "FaultTo");
-
+
public static final String WSA_ACTION_NAME = "Action";
- public static final QName WSA_ACTION_QNAME =
+ public static final QName WSA_ACTION_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_ACTION_NAME);
public static final String WSA_MESSAGEID_NAME = "MessageID";
- public static final QName WSA_MESSAGEID_QNAME =
- new QName(WSA_NAMESPACE_NAME, WSA_MESSAGEID_NAME);
-
+ public static final QName WSA_MESSAGEID_QNAME =
+ new QName(WSA_NAMESPACE_NAME, WSA_MESSAGEID_NAME);
+
public static final String WSA_REPLY_NAME = "reply";
public static final String WSA_RELATIONSHIP_DELIMITER = "/";
- public static final String WSA_RELATIONSHIP_REPLY =
+ public static final String WSA_RELATIONSHIP_REPLY =
WSA_NAMESPACE_NAME + WSA_RELATIONSHIP_DELIMITER + WSA_REPLY_NAME;
-
+
public static final String WSA_RELATESTO_NAME = "RelatesTo";
public static final QName WSA_RELATESTO_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_RELATESTO_NAME);
public static final String WSA_RELATIONSHIPTYPE_NAME = "RelationshipType";
- public static final QName WSA_RELATIONSHIPTYPE_QNAME =
+ public static final QName WSA_RELATIONSHIPTYPE_QNAME =
new QName(WSA_NAMESPACE_NAME, WSA_RELATIONSHIPTYPE_NAME);
-
- public static final String WSA_ANONYMOUS_ADDRESS =
+
+ public static final String WSA_ANONYMOUS_ADDRESS =
WSA_NAMESPACE_NAME + "/anonymous";
public static final String WSA_NONE_ADDRESS =
WSA_NAMESPACE_NAME + "/none";
-
+
public static final String WSA_UNSPECIFIED_RELATIONSHIP =
WSA_NAMESPACE_NAME + "/unspecified";
@@ -109,37 +109,37 @@ public final class Names {
"/fault";
public static final String WSA_DEFAULT_FAULT_ACTION =
WSA_NAMESPACE_NAME + WSA_FAULT_DELIMITER;
-
+
public static final String WSAW_ACTION_NAME = "Action";
- public static final QName WSAW_ACTION_QNAME =
+ public static final QName WSAW_ACTION_QNAME =
new QName(WSA_NAMESPACE_WSDL_NAME, WSAW_ACTION_NAME);
-
+
public static final String WSAW_USING_ADDRESSING_NAME = "UsingAddressing";
- public static final QName WSAW_USING_ADDRESSING_QNAME =
+ public static final QName WSAW_USING_ADDRESSING_QNAME =
new QName(WSA_NAMESPACE_WSDL_NAME, WSAW_USING_ADDRESSING_NAME);
-
- public static final String WSDL_INSTANCE_NAMESPACE_NAME =
+
+ public static final String WSDL_INSTANCE_NAMESPACE_NAME =
"http://www.w3.org/2004/08/wsdl-instance";
public static final String INVALID_MAP_NAME =
- "InvalidMessageAddressingProperty";
- public static final QName INVALID_MAP_QNAME =
+ "InvalidMessageAddressingProperty";
+ public static final QName INVALID_MAP_QNAME =
new QName(WSA_NAMESPACE_NAME, INVALID_MAP_NAME);
public static final String MAP_REQUIRED_NAME =
"MessageAddressingPropertyRequired";
- public static final QName MAP_REQUIRED_QNAME =
+ public static final QName MAP_REQUIRED_QNAME =
new QName(WSA_NAMESPACE_NAME, MAP_REQUIRED_NAME);
public static final String DESTINATION_UNREACHABLE_NAME =
"DestinationUnreachable";
- public static final QName DESTINATION_UNREACHABLE_QNAME =
+ public static final QName DESTINATION_UNREACHABLE_QNAME =
new QName(WSA_NAMESPACE_NAME, DESTINATION_UNREACHABLE_NAME);
public static final String ACTION_NOT_SUPPORTED_NAME =
"ActionNotSupported";
- public static final QName ACTION_NOT_SUPPORTED_QNAME =
+ public static final QName ACTION_NOT_SUPPORTED_QNAME =
new QName(WSA_NAMESPACE_NAME, ACTION_NOT_SUPPORTED_NAME);
public static final String ENDPOINT_UNAVAILABLE_NAME =
"EndpointUnavailable";
- public static final QName ENDPOINT_UNAVAILABLE_QNAME =
+ public static final QName ENDPOINT_UNAVAILABLE_QNAME =
new QName(WSA_NAMESPACE_NAME, ENDPOINT_UNAVAILABLE_NAME);
public static final String DUPLICATE_MESSAGE_ID_NAME =
@@ -157,20 +157,20 @@ public final class Names {
public static final QName HEADER_REQUIRED_QNAME =
new QName(WSA_NAMESPACE_NAME, HEADER_REQUIRED_NAME);
- public static final String ONLY_ANONYMOUS_ADDRESS_SUPPORTED_NAME =
+ public static final String ONLY_ANONYMOUS_ADDRESS_SUPPORTED_NAME =
"OnlyAnonymousAddressSupported";
public static final QName ONLY_ANONYMOUS_ADDRESS_SUPPORTED_QNAME =
new QName(WSA_NAMESPACE_NAME, ONLY_ANONYMOUS_ADDRESS_SUPPORTED_NAME);
-
- public static final String ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_NAME =
+
+ public static final String ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_NAME =
"OnlyNonAnonymousAddressSupported";
public static final QName ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_QNAME =
new QName(WSA_NAMESPACE_NAME, ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_NAME);
-
+
public static final String INVALID_CARDINALITY_NAME = "InvalidCardinality";
public static final QName INVALID_CARDINALITY_QNAME = new QName(WSA_NAMESPACE_NAME,
INVALID_CARDINALITY_NAME);
-
+
/**
* The set of headers understood by the protocol binding.
*/
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java b/core/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
index 345fcac..77ec674 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
@@ -36,7 +36,7 @@ import javax.xml.namespace.QName;
import org.w3c.dom.Element;
import org.apache.cxf.common.jaxb.JAXBUtils;
-// importation convention: if the same class name is used for
+// importation convention: if the same class name is used for
// 2005/08 and 2004/08, then the former version is imported
// and the latter is fully qualified when used
import org.apache.cxf.helpers.DOMUtils;
@@ -47,7 +47,7 @@ import org.apache.cxf.ws.addressing.v200408.Relationship;
import org.apache.cxf.ws.addressing.v200408.ServiceNameType;
/**
- * This class is responsible for transforming between the native
+ * This class is responsible for transforming between the native
* WS-Addressing schema version (i.e. 2005/08) and exposed
* version (currently may be 2005/08 or 2004/08).
* <p>
@@ -55,51 +55,51 @@ import org.apache.cxf.ws.addressing.v200408.ServiceNameType;
* WS-A types are represented via the JAXB generated types for the
* 2005/08 schema.
* <p>
- * The exposed version is that used when the WS-A types are
- * externalized, i.e. are encoded in the headers of outgoing
- * messages. For outgoing requests, the exposed version is
+ * The exposed version is that used when the WS-A types are
+ * externalized, i.e. are encoded in the headers of outgoing
+ * messages. For outgoing requests, the exposed version is
* determined from configuration. For outgoing responses, the
* exposed version is determined by the exposed version of
* the corresponding request.
* <p>
* The motivation for using different native and exposed types
- * is usually to facilitate a WS-* standard based on an earlier
+ * is usually to facilitate a WS-* standard based on an earlier
* version of WS-Adressing (for example WS-RM depends on the
* 2004/08 version).
*/
public class VersionTransformer {
protected static final String NATIVE_VERSION = Names.WSA_NAMESPACE_NAME;
-
+
/**
* Constructor.
*/
protected VersionTransformer() {
}
-
+
/**
* @param namespace a namspace URI to consider
- * @return true if th WS-Addressing version specified by the namespace
+ * @return true if th WS-Addressing version specified by the namespace
* URI is supported
*/
public static boolean isSupported(String namespace) {
- return NATIVE_VERSION.equals(namespace)
+ return NATIVE_VERSION.equals(namespace)
|| Names200408.WSA_NAMESPACE_NAME.equals(namespace)
|| Names200403.WSA_NAMESPACE_NAME.equals(namespace);
}
-
+
/**
* Convert from 2005/08 AttributedURI to 2004/08 AttributedURI.
- *
+ *
* @param internal the 2005/08 AttributedURIType
* @return an equivalent 2004/08 AttributedURI
*/
public static AttributedURI convert(AttributedURIType internal) {
- AttributedURI exposed =
+ AttributedURI exposed =
Names200408.WSA_OBJECT_FACTORY.createAttributedURI();
String exposedValue =
Names.WSA_ANONYMOUS_ADDRESS.equals(internal.getValue())
- ? Names200408.WSA_ANONYMOUS_ADDRESS
+ ? Names200408.WSA_ANONYMOUS_ADDRESS
: Names.WSA_NONE_ADDRESS.equals(internal.getValue())
? Names200408.WSA_NONE_ADDRESS
: internal.getValue();
@@ -110,13 +110,13 @@ public class VersionTransformer {
/**
* Convert from 2005/08 AttributedURI to 2004/03 AttributedURI.
- *
+ *
* @param internal the 2005/08 AttributedURIType
* @return an equivalent 2004/08 or 2004/03 AttributedURI
*/
- public static org.apache.cxf.ws.addressing.v200403.AttributedURI
+ public static org.apache.cxf.ws.addressing.v200403.AttributedURI
convertTo200403(AttributedURIType internal) {
-
+
org.apache.cxf.ws.addressing.v200403.AttributedURI exposed = Names200403.WSA_OBJECT_FACTORY
.createAttributedURI();
String exposedValue = Names.WSA_ANONYMOUS_ADDRESS.equals(internal.getValue())
@@ -128,27 +128,27 @@ public class VersionTransformer {
}
/**
* Convert from 2004/08 AttributedURI to 2005/08 AttributedURI.
- *
+ *
* @param exposed the 2004/08 AttributedURI
* @return an equivalent 2005/08 AttributedURIType
*/
public static AttributedURIType convert(AttributedURI exposed) {
- AttributedURIType internal =
+ AttributedURIType internal =
ContextUtils.WSA_OBJECT_FACTORY.createAttributedURIType();
String internalValue =
Names200408.WSA_ANONYMOUS_ADDRESS.equals(exposed.getValue())
- ? Names.WSA_ANONYMOUS_ADDRESS
+ ? Names.WSA_ANONYMOUS_ADDRESS
: Names200408.WSA_NONE_ADDRESS.equals(exposed.getValue())
? Names.WSA_NONE_ADDRESS
: exposed.getValue();
internal.setValue(internalValue);
putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
- return internal;
+ return internal;
}
-
+
/**
* Convert from 2004/03 AttributedURI to 2005/08 AttributedURI.
- *
+ *
* @param exposed the 2004/03 AttributedURI
* @return an equivalent 2005/08 AttributedURIType
*/
@@ -160,12 +160,12 @@ public class VersionTransformer {
internal.setValue(internalValue);
putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
return internal;
- }
+ }
/**
- * Convert from 2005/08 EndpointReferenceType to 2004/08
+ * Convert from 2005/08 EndpointReferenceType to 2004/08
* EndpointReferenceType.
- *
+ *
* @param internal the 2005/08 EndpointReferenceType
* @return an equivalent 2004/08 EndpointReferenceType
*/
@@ -188,9 +188,9 @@ public class VersionTransformer {
String namespace = serviceQName.getNamespaceURI() != null
? serviceQName.getNamespaceURI()
: Names.WSDL_INSTANCE_NAMESPACE_NAME;
- QName portQName =
+ QName portQName =
new QName(namespace, portLocalName);
- AttributedQName portType =
+ AttributedQName portType =
Names200408.WSA_OBJECT_FACTORY.createAttributedQName();
portType.setValue(portQName);
exposed.setPortType(portType);
@@ -200,14 +200,14 @@ public class VersionTransformer {
putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
return exposed;
}
-
+
/**
* Convert from 2005/08 EndpointReferenceType to 2004/03 EndpointReferenceType.
- *
+ *
* @param internal the 2005/08 EndpointReferenceType
* @return an equivalent 2004/03 EndpointReferenceType
*/
- public static org.apache.cxf.ws.addressing.v200403.EndpointReferenceType
+ public static org.apache.cxf.ws.addressing.v200403.EndpointReferenceType
convertTo200403(EndpointReferenceType internal) {
org.apache.cxf.ws.addressing.v200403.EndpointReferenceType exposed = Names200403.WSA_OBJECT_FACTORY
.createEndpointReferenceType();
@@ -236,15 +236,15 @@ public class VersionTransformer {
return exposed;
}
/**
- * Convert from 2004/08 EndpointReferenceType to 2005/08
+ * Convert from 2004/08 EndpointReferenceType to 2005/08
* EndpointReferenceType.
- *
+ *
* @param exposed the 2004/08 EndpointReferenceType
* @return an equivalent 2005/08 EndpointReferenceType
*/
public static EndpointReferenceType convert(
org.apache.cxf.ws.addressing.v200408.EndpointReferenceType exposed) {
- EndpointReferenceType internal =
+ EndpointReferenceType internal =
ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType();
internal.setAddress(convert(exposed.getAddress()));
internal.setReferenceParameters(
@@ -252,7 +252,7 @@ public class VersionTransformer {
ServiceNameType serviceName = exposed.getServiceName();
AttributedQName portName = exposed.getPortType();
if (serviceName != null && portName != null) {
- EndpointReferenceUtils.setServiceAndPortName(internal,
+ EndpointReferenceUtils.setServiceAndPortName(internal,
serviceName.getValue(),
portName.getValue().getLocalPart());
}
@@ -260,12 +260,12 @@ public class VersionTransformer {
// no direct analogue for ReferenceProperties
addAll(internal.getAny(), exposed.getAny());
putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
- return internal;
+ return internal;
}
/**
* Convert from 2004/03 EndpointReferenceType to 2005/08 EndpointReferenceType.
- *
+ *
* @param exposed the 2004/03 EndpointReferenceType
* @return an equivalent 2005/08 EndpointReferenceType
*/
@@ -286,31 +286,31 @@ public class VersionTransformer {
addAll(internal.getAny(), exposed.getAny());
putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
return internal;
- }
-
+ }
+
/**
* Convert from 2005/08 ReferenceParametersType to 2004/08
* ReferenceParametersType.
- *
+ *
* @param internal the 2005/08 ReferenceParametersType
* @return an equivalent 2004/08 ReferenceParametersType
*/
public static org.apache.cxf.ws.addressing.v200408.ReferenceParametersType convert(
ReferenceParametersType internal) {
- org.apache.cxf.ws.addressing.v200408.ReferenceParametersType exposed =
+ org.apache.cxf.ws.addressing.v200408.ReferenceParametersType exposed =
null;
if (internal != null) {
exposed =
Names200408.WSA_OBJECT_FACTORY.createReferenceParametersType();
addAll(exposed.getAny(), internal.getAny());
}
- return exposed;
+ return exposed;
}
-
+
/**
* Convert from 2004/08 ReferenceParametersType to 2005/08
* ReferenceParametersType.
- *
+ *
* @param exposed the 2004/08 ReferenceParametersType
* @return an equivalent 2005/08 ReferenceParametersType
*/
@@ -318,17 +318,17 @@ public class VersionTransformer {
org.apache.cxf.ws.addressing.v200408.ReferenceParametersType exposed) {
ReferenceParametersType internal = null;
if (exposed != null) {
- internal =
+ internal =
ContextUtils.WSA_OBJECT_FACTORY.createReferenceParametersType();
addAll(internal.getAny(), exposed.getAny());
}
- return internal;
+ return internal;
}
// THERE IS NO ReferenceParametersType for 2004/03
/**
* Convert from 2005/08 RelatesToType to 2004/08 Relationship.
- *
+ *
* @param internal the 2005/08 RelatesToType
* @return an equivalent 2004/08 Relationship
*/
@@ -352,7 +352,7 @@ public class VersionTransformer {
/**
* Convert from 2005/08 RelatesToType to 2004/03 Relationship.
- *
+ *
* @param internal the 2005/08 RelatesToType
* @return an equivalent 2004/03 Relationship
*/
@@ -373,20 +373,20 @@ public class VersionTransformer {
}
return exposed;
}
-
+
/** Convert from 2004/08 Relationship to 2005/08 RelatesToType.
- *
+ *
* @param exposed the 2004/08 Relationship
* @return an equivalent 2005/08 RelatesToType
*/
- public static RelatesToType convert(Relationship exposed) {
+ public static RelatesToType convert(Relationship exposed) {
RelatesToType internal = null;
if (exposed != null) {
internal = ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType();
internal.setValue(exposed.getValue());
QName exposedRelationshipType = exposed.getRelationshipType();
if (exposedRelationshipType != null) {
- String internalRelationshipType =
+ String internalRelationshipType =
Names.WSA_REPLY_NAME.equalsIgnoreCase(
exposedRelationshipType.getLocalPart())
? Names.WSA_RELATIONSHIP_REPLY
@@ -395,12 +395,12 @@ public class VersionTransformer {
}
internal.getOtherAttributes().putAll(exposed.getOtherAttributes());
}
- return internal;
+ return internal;
}
-
+
/**
* Convert from 2004/03 Relationship to 2005/08 RelatesToType.
- *
+ *
* @param exposed the 2004/03 Relationship
* @return an equivalent 2005/08 RelatesToType
*/
@@ -419,8 +419,8 @@ public class VersionTransformer {
}
return internal;
}
-
-
+
+
/**
* Parse an EndpointReferenceType from a DOM element. Handles all of
* the WS-Addressing namespaces currently supported.
@@ -464,7 +464,7 @@ public class VersionTransformer {
return convert((org.apache.cxf.ws.addressing.v200408.EndpointReferenceType)exposed);
} else if (Names200403.EPR_TYPE.isInstance(exposed)) {
return convert((org.apache.cxf.ws.addressing.v200403.EndpointReferenceType)exposed);
- }
+ }
return null;
}
@@ -475,11 +475,11 @@ public class VersionTransformer {
*/
public static Class<?> getExposedReferenceType(String exposedURI) {
return NATIVE_VERSION.equals(exposedURI)
- ? EndpointReferenceType.class
- : Names200408.WSA_NAMESPACE_NAME.equals(exposedURI) ? Names200408.EPR_TYPE
+ ? EndpointReferenceType.class
+ : Names200408.WSA_NAMESPACE_NAME.equals(exposedURI) ? Names200408.EPR_TYPE
: Names200403.WSA_NAMESPACE_NAME.equals(exposedURI) ? Names200403.EPR_TYPE : null;
}
-
+
/**
* @param exposedURI specifies the version WS-Addressing
* @return JABXContext for the exposed namespace URI
@@ -494,7 +494,7 @@ public class VersionTransformer {
/**
* Put all entries from one map into another.
- *
+ *
* @param to target map
* @param from source map
*/
@@ -506,7 +506,7 @@ public class VersionTransformer {
/**
* Add all entries from one list into another.
- *
+ *
* @param to target list
* @param from source list
*/
@@ -520,27 +520,27 @@ public class VersionTransformer {
* Holder for 2004/08 Names
*/
public static class Names200408 {
- public static final String WSA_NAMESPACE_NAME =
+ public static final String WSA_NAMESPACE_NAME =
"http://schemas.xmlsoap.org/ws/2004/08/addressing";
- public static final String WSA_ANONYMOUS_ADDRESS =
+ public static final String WSA_ANONYMOUS_ADDRESS =
WSA_NAMESPACE_NAME + "/role/anonymous";
public static final String WSA_NONE_ADDRESS =
WSA_NAMESPACE_NAME + "/role/none";
- public static final ObjectFactory WSA_OBJECT_FACTORY =
+ public static final ObjectFactory WSA_OBJECT_FACTORY =
new ObjectFactory();
- public static final Class<org.apache.cxf.ws.addressing.v200408.EndpointReferenceType> EPR_TYPE
+ public static final Class<org.apache.cxf.ws.addressing.v200408.EndpointReferenceType> EPR_TYPE
= org.apache.cxf.ws.addressing.v200408.EndpointReferenceType.class;
-
+
private static JAXBContext jaxbContext;
-
+
protected Names200408() {
}
-
+
/**
* Retrieve a JAXBContext for marshalling and unmarshalling JAXB generated
* types for the 2004/08 version.
*
- * @return a JAXBContext
+ * @return a JAXBContext
*/
public static JAXBContext getJAXBContext() throws JAXBException {
synchronized (Names200408.class) {
@@ -550,17 +550,17 @@ public class VersionTransformer {
}
return jaxbContext;
}
-
+
/**
* Set the encapsulated JAXBContext (used by unit tests).
- *
- * @param ctx JAXBContext
+ *
+ * @param ctx JAXBContext
*/
public static void setJAXBContext(JAXBContext ctx) throws JAXBException {
synchronized (Names200408.class) {
jaxbContext = ctx;
}
- }
+ }
}
/**
* Holder for 2004/03 Names
@@ -569,9 +569,9 @@ public class VersionTransformer {
public static final String WSA_NAMESPACE_NAME = "http://schemas.xmlsoap.org/ws/2004/03/addressing";
public static final String WSA_ANONYMOUS_ADDRESS = WSA_NAMESPACE_NAME + "/role/anonymous";
public static final String WSA_NONE_ADDRESS = WSA_NAMESPACE_NAME + "/role/none";
- public static final org.apache.cxf.ws.addressing.v200403.ObjectFactory WSA_OBJECT_FACTORY =
+ public static final org.apache.cxf.ws.addressing.v200403.ObjectFactory WSA_OBJECT_FACTORY =
new org.apache.cxf.ws.addressing.v200403.ObjectFactory();
- public static final Class<org.apache.cxf.ws.addressing.v200403.EndpointReferenceType> EPR_TYPE =
+ public static final Class<org.apache.cxf.ws.addressing.v200403.EndpointReferenceType> EPR_TYPE =
org.apache.cxf.ws.addressing.v200403.EndpointReferenceType.class;
private static JAXBContext jaxbContext;
@@ -582,7 +582,7 @@ public class VersionTransformer {
/**
* Retrieve a JAXBContext for marshalling and unmarshalling JAXB generated types for the 2004/08
* version.
- *
+ *
* @return a JAXBContext
*/
public static JAXBContext getJAXBContext() throws JAXBException {
@@ -596,7 +596,7 @@ public class VersionTransformer {
/**
* Set the encapsulated JAXBContext (used by unit tests).
- *
+ *
* @param ctx JAXBContext
*/
public static void setJAXBContext(JAXBContext ctx) throws JAXBException {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java b/core/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
index aa727e0..3c760bc 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/WSAContextUtils.java
@@ -33,7 +33,7 @@ public final class WSAContextUtils {
"org.apache.cxf.ws.addressing.decoupled.endpoint.base";
private static final String USING_PROPERTY =
- "org.apache.cxf.ws.addressing.using";
+ "org.apache.cxf.ws.addressing.using";
/**
* Prevents instantiation.
@@ -46,7 +46,7 @@ public final class WSAContextUtils {
*
* @param message the current message
* @return true if UsingAddressing should be overridden
- */
+ */
public static boolean retrieveUsingAddressing(Message message) {
Boolean override = (Boolean)message.get(USING_PROPERTY);
return override == null || override.booleanValue();
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java b/core/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
index 7d81600..0f146c8 100644
--- a/core/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
+++ b/core/src/main/java/org/apache/cxf/ws/addressing/WSAddressingFeature.java
@@ -30,17 +30,17 @@ public class WSAddressingFeature extends AbstractFeature {
NON_ANONYMOUS,
ANONYMOUS,
}
-
+
public interface WSAddressingFeatureApplier {
void initializeProvider(WSAddressingFeature feature, InterceptorProvider provider, Bus bus);
}
-
+
boolean allowDuplicates = true;
boolean usingAddressingAdvisory = true;
boolean required;
MessageIdCache cache;
AddressingResponses responses = AddressingResponses.ALL;
-
+
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
bus.getExtension(WSAddressingFeatureApplier.class).initializeProvider(this, provider, bus);
@@ -49,7 +49,7 @@ public class WSAddressingFeature extends AbstractFeature {
public void setAllowDuplicates(boolean allow) {
allowDuplicates = allow;
}
-
+
public boolean isAllowDuplicates() {
return allowDuplicates;
}
@@ -57,19 +57,19 @@ public class WSAddressingFeature extends AbstractFeature {
public void setUsingAddressingAdvisory(boolean advisory) {
usingAddressingAdvisory = advisory;
}
-
+
public boolean isUsingAddressingAdvisory() {
return usingAddressingAdvisory;
}
-
+
public boolean isAddressingRequired() {
return required;
}
public void setAddressingRequired(boolean r) {
- required = r;
+ required = r;
}
-
+
/**
* Returns the cache used to enforce duplicate message IDs when
* {@link #isAllowDuplicates()} returns {@code false}.
@@ -101,5 +101,5 @@ public class WSAddressingFeature extends AbstractFeature {
public AddressingResponses getResponses() {
return responses;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/BusFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/BusFactoryTest.java b/core/src/test/java/org/apache/cxf/BusFactoryTest.java
index 5268042..53ad06d 100644
--- a/core/src/test/java/org/apache/cxf/BusFactoryTest.java
+++ b/core/src/test/java/org/apache/cxf/BusFactoryTest.java
@@ -26,19 +26,19 @@ import org.junit.Test;
public class BusFactoryTest extends Assert {
-
+
@After
public void tearDown() {
- System.clearProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME);
+ System.clearProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME);
}
-
+
@Test
public void testGetInstance() {
System.setProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME, TestBusFactory.class.getName());
BusFactory factory = BusFactory.newInstance();
assertTrue(factory instanceof TestBusFactory);
}
-
+
public static class TestBusFactory extends BusFactory {
public Bus createBus() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
index 9d890dd..51eb3b5 100644
--- a/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
+++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
@@ -51,20 +51,20 @@ import org.junit.Before;
import org.junit.Test;
public class AttachmentDeserializerTest extends Assert {
-
+
private MessageImpl msg;
-
+
@Before
public void setUp() throws Exception {
msg = new MessageImpl();
Exchange exchange = new ExchangeImpl();
msg.setExchange(exchange);
}
-
+
@Test
public void testNoBoundaryInCT() throws Exception {
//CXF-2623
- String message = "SomeHeader: foo\n"
+ String message = "SomeHeader: foo\n"
+ "------=_Part_34950_1098328613.1263781527359\n"
+ "Content-Type: text/xml; charset=UTF-8\n"
+ "Content-Transfer-Encoding: binary\n"
@@ -78,12 +78,12 @@ public class AttachmentDeserializerTest extends Assert {
+ "\n"
+ "<message>\n"
+ "------=_Part_34950_1098328613.1263781527359--";
-
+
Matcher m = Pattern.compile("^--(\\S*)$").matcher(message);
Assert.assertFalse(m.find());
m = Pattern.compile("^--(\\S*)$", Pattern.MULTILINE).matcher(message);
Assert.assertTrue(m.find());
-
+
msg = new MessageImpl();
msg.setContent(InputStream.class, new ByteArrayInputStream(message.getBytes(StandardCharsets.UTF_8)));
msg.put(Message.CONTENT_TYPE, "multipart/related");
@@ -91,7 +91,7 @@ public class AttachmentDeserializerTest extends Assert {
ad.initializeAttachments();
assertEquals(1, msg.getAttachments().size());
}
-
+
@Test
public void testLazyAttachmentCollection() throws Exception {
InputStream is = getClass().getResourceAsStream("mimedata2");
@@ -99,13 +99,13 @@ public class AttachmentDeserializerTest extends Assert {
+ "start=\"<so...@xfire.codehaus.org>\"; "
+ "start-info=\"text/xml; charset=utf-8\"; "
+ "boundary=\"----=_Part_4_701508.1145579811786\"";
-
+
msg.put(Message.CONTENT_TYPE, ct);
msg.setContent(InputStream.class, is);
-
+
AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);
deserializer.initializeAttachments();
-
+
InputStream attBody = msg.getContent(InputStream.class);
assertTrue(attBody != is);
assertTrue(attBody instanceof DelegatingInputStream);
@@ -114,7 +114,7 @@ public class AttachmentDeserializerTest extends Assert {
List<String> cidlist = new ArrayList<>();
cidlist.add("xfire_logo.jpg");
cidlist.add("xfire_logo2.jpg");
-
+
for (Iterator<Attachment> it = msg.getAttachments().iterator(); it.hasNext();) {
Attachment a = it.next();
assertTrue(cidlist.remove(a.getId()));
@@ -124,7 +124,7 @@ public class AttachmentDeserializerTest extends Assert {
assertEquals(0, msg.getAttachments().size());
is.close();
}
-
+
@Test
public void testDeserializerMtom() throws Exception {
InputStream is = getClass().getResourceAsStream("mimedata");
@@ -132,41 +132,41 @@ public class AttachmentDeserializerTest extends Assert {
+ "start=\"<so...@xfire.codehaus.org>\"; "
+ "start-info=\"text/xml; charset=utf-8\"; "
+ "boundary=\"----=_Part_4_701508.1145579811786\"";
-
+
msg.put(Message.CONTENT_TYPE, ct);
msg.setContent(InputStream.class, is);
-
+
AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);
deserializer.initializeAttachments();
-
+
InputStream attBody = msg.getContent(InputStream.class);
assertTrue(attBody != is);
assertTrue(attBody instanceof DelegatingInputStream);
-
+
Collection<Attachment> atts = msg.getAttachments();
assertNotNull(atts);
-
+
Iterator<Attachment> itr = atts.iterator();
assertTrue(itr.hasNext());
-
+
Attachment a = itr.next();
assertNotNull(a);
-
+
InputStream attIs = a.getDataHandler().getInputStream();
-
+
// check the cached output stream
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
IOUtils.copy(attBody, out);
assertTrue(out.toString().startsWith("<env:Envelope"));
}
-
+
// try streaming a character off the wire
assertEquals(255, attIs.read());
assertEquals(216, (char)attIs.read());
-
+
// Attachment invalid = atts.get("INVALID");
// assertNull(invalid.getDataHandler().getInputStream());
-//
+//
// assertTrue(attIs instanceof ByteArrayInputStream);
is.close();
}
@@ -216,7 +216,7 @@ public class AttachmentDeserializerTest extends Assert {
// assertTrue(attIs instanceof ByteArrayInputStream);
is.close();
}
-
+
@Test
public void testDeserializerSwA() throws Exception {
InputStream is = getClass().getResourceAsStream("swadata");
@@ -224,26 +224,26 @@ public class AttachmentDeserializerTest extends Assert {
+ "start=\"<86048FF3556694F7DA1918466DDF8143>\"; "
+ "boundary=\"----=_Part_0_14158819.1167275505862\"";
-
+
msg.put(Message.CONTENT_TYPE, ct);
msg.setContent(InputStream.class, is);
-
+
AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);
deserializer.initializeAttachments();
-
+
InputStream attBody = msg.getContent(InputStream.class);
assertTrue(attBody != is);
assertTrue(attBody instanceof DelegatingInputStream);
-
+
Collection<Attachment> atts = msg.getAttachments();
assertNotNull(atts);
-
+
Iterator<Attachment> itr = atts.iterator();
assertTrue(itr.hasNext());
-
+
Attachment a = itr.next();
assertNotNull(a);
-
+
InputStream attIs = a.getDataHandler().getInputStream();
// check the cached output stream
@@ -251,7 +251,7 @@ public class AttachmentDeserializerTest extends Assert {
IOUtils.copy(attBody, out);
assertTrue(out.toString().startsWith("<?xml"));
}
-
+
// try streaming a character off the wire
assertTrue(attIs.read() == 'f');
assertTrue(attIs.read() == 'o');
@@ -263,40 +263,40 @@ public class AttachmentDeserializerTest extends Assert {
is.close();
}
-
+
@Test
public void testDeserializerSwAWithoutBoundryInContentType() throws Exception {
InputStream is = getClass().getResourceAsStream("swadata");
String ct = "multipart/related; type=\"text/xml\"; ";
-
+
msg.put(Message.CONTENT_TYPE, ct);
msg.setContent(InputStream.class, is);
-
+
AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);
deserializer.initializeAttachments();
-
+
InputStream attBody = msg.getContent(InputStream.class);
assertTrue(attBody != is);
assertTrue(attBody instanceof DelegatingInputStream);
-
+
Collection<Attachment> atts = msg.getAttachments();
assertNotNull(atts);
-
+
Iterator<Attachment> itr = atts.iterator();
assertTrue(itr.hasNext());
-
+
Attachment a = itr.next();
assertNotNull(a);
-
+
InputStream attIs = a.getDataHandler().getInputStream();
-
+
// check the cached output stream
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
IOUtils.copy(attBody, out);
assertTrue(out.toString().startsWith("<?xml"));
}
-
+
// try streaming a character off the wire
assertTrue(attIs.read() == 'f');
assertTrue(attIs.read() == 'o');
@@ -305,11 +305,11 @@ public class AttachmentDeserializerTest extends Assert {
assertTrue(attIs.read() == 'a');
assertTrue(attIs.read() == 'r');
assertTrue(attIs.read() == -1);
-
+
assertFalse(itr.hasNext());
is.close();
}
-
+
@Test
public void testDeserializerWithCachedFile() throws Exception {
InputStream is = getClass().getResourceAsStream("mimedata");
@@ -317,39 +317,39 @@ public class AttachmentDeserializerTest extends Assert {
+ "start=\"<so...@xfire.codehaus.org>\"; "
+ "start-info=\"text/xml; charset=utf-8\"; "
+ "boundary=\"----=_Part_4_701508.1145579811786\"";
-
+
msg.put(Message.CONTENT_TYPE, ct);
msg.setContent(InputStream.class, is);
msg.put(AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD, "10");
-
+
AttachmentDeserializer deserializer = new AttachmentDeserializer(msg);
deserializer.initializeAttachments();
-
+
InputStream attBody = msg.getContent(InputStream.class);
assertTrue(attBody != is);
assertTrue(attBody instanceof DelegatingInputStream);
-
+
Collection<Attachment> atts = msg.getAttachments();
assertNotNull(atts);
-
+
Iterator<Attachment> itr = atts.iterator();
assertTrue(itr.hasNext());
-
+
Attachment a = itr.next();
assertNotNull(a);
-
+
InputStream attIs = a.getDataHandler().getInputStream();
-
+
assertFalse(itr.hasNext());
-
+
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
IOUtils.copy(attIs, out);
assertTrue(out.size() > 1000);
}
is.close();
}
-
-
+
+
@Test
public void testSmallStream() throws Exception {
byte[] messageBytes = ("------=_Part_1\n\nJJJJ\n------=_Part_1\n\n"
@@ -362,13 +362,13 @@ public class AttachmentDeserializerTest extends Assert {
MimeBodyPartInputStream m = new MimeBodyPartInputStream(pushbackStream, "------=_Part_1".getBytes(),
2048);
-
+
assertEquals(10, m.read(new byte[1000]));
assertEquals(-1, m.read(new byte[1000]));
assertEquals(-1, m.read(new byte[1000]));
m.close();
}
-
+
@Test
public void testCXF2542() throws Exception {
StringBuilder buf = new StringBuilder();
@@ -387,7 +387,7 @@ public class AttachmentDeserializerTest extends Assert {
InputStream rawInputStream = new ByteArrayInputStream(buf.toString().getBytes());
MessageImpl message = new MessageImpl();
message.setContent(InputStream.class, rawInputStream);
- message.put(Message.CONTENT_TYPE,
+ message.put(Message.CONTENT_TYPE,
"multipart/related; type=\"application/xop+xml\"; "
+ "start=\"<so...@xfire.codehaus.org>\"; "
+ "start-info=\"text/xml\"; boundary=\"----=_Part_0_2180223.1203118300920\"");
@@ -399,7 +399,7 @@ public class AttachmentDeserializerTest extends Assert {
inputStreamWithoutAttachments.close();
rawInputStream.close();
}
-
+
@Test
public void imitateAttachmentInInterceptorForMessageWithMissingBoundary() throws Exception {
ByteArrayInputStream inputStream;
@@ -419,8 +419,8 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/mixed"));
ad.initializeAttachments();
@@ -446,10 +446,10 @@ public class AttachmentDeserializerTest extends Assert {
+ "------=_Part_1--").getBytes(StandardCharsets.UTF_8);
ByteArrayInputStream in = new ByteArrayInputStream(messageBytes) {
public int read(byte[] b, int off, int len) {
- return super.read(b, off, len >= 2 ? 2 : len);
+ return super.read(b, off, len >= 2 ? 2 : len);
}
};
-
+
Message message = new MessageImpl();
message.put(Message.CONTENT_TYPE, contentType);
message.setContent(InputStream.class, in);
@@ -459,12 +459,12 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/mixed"));
ad.initializeAttachments();
-
+
String s = getString(message.getContent(InputStream.class));
assertEquals("JJJJ", s.trim());
int count = 1;
@@ -475,7 +475,7 @@ public class AttachmentDeserializerTest extends Assert {
in.close();
}
-
+
private String getString(InputStream ins) throws Exception {
try (ByteArrayOutputStream bout = new ByteArrayOutputStream(100)) {
byte b[] = new byte[100];
@@ -490,13 +490,13 @@ public class AttachmentDeserializerTest extends Assert {
return bout.toString();
}
}
-
+
@Test
public void testCXF3383() throws Exception {
String contentType = "multipart/related; type=\"application/xop+xml\";"
- + " boundary=\"uuid:7a555f51-c9bb-4bd4-9929-706899e2f793\"; start="
+ + " boundary=\"uuid:7a555f51-c9bb-4bd4-9929-706899e2f793\"; start="
+ "\"<ro...@cxf.apache.org>\"; start-info=\"text/xml\"";
-
+
Message message = new MessageImpl();
message.put(Message.CONTENT_TYPE, contentType);
message.setContent(InputStream.class, getClass().getResourceAsStream("cxf3383.data"));
@@ -506,18 +506,18 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/related"));
-
+
ad.initializeAttachments();
-
-
+
+
for (int x = 1; x < 50; x++) {
String cid = "1882f79d-e20a-4b36-a222-7a75518cf395-" + x + "@cxf.apache.org";
DataSource ds = AttachmentUtil.getAttachmentDataSource(cid, message.getAttachments());
byte bts[] = new byte[1024];
-
+
InputStream ins = ds.getInputStream();
int count = 0;
int sz = ins.read(bts, 0, bts.length);
@@ -532,14 +532,14 @@ public class AttachmentDeserializerTest extends Assert {
}
}
-
+
@Test
public void testCXF3582() throws Exception {
String contentType = "multipart/related; type=\"application/xop+xml\"; "
+ "boundary=\"uuid:906fa67b-85f9-4ef5-8e3d-52416022d463\"; "
+ "start=\"<ro...@cxf.apache.org>\"; start-info=\"text/xml\"";
-
-
+
+
Message message = new MessageImpl();
message.put(Message.CONTENT_TYPE, contentType);
message.setContent(InputStream.class, getClass().getResourceAsStream("cxf3582.data"));
@@ -549,12 +549,12 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/related"));
-
+
ad.initializeAttachments();
-
+
String cid = "1a66bb35-67fc-4e89-9f33-48af417bf9fe-1@apache.org";
DataSource ds = AttachmentUtil.getAttachmentDataSource(cid, message.getAttachments());
byte bts[] = new byte[1024];
@@ -580,8 +580,8 @@ public class AttachmentDeserializerTest extends Assert {
String contentType = "multipart/related; type=\"application/xop+xml\"; "
+ "boundary=\"uuid:906fa67b-85f9-4ef5-8e3d-52416022d463\"; "
+ "start=\"<ro...@cxf.apache.org>\"; start-info=\"text/xml\"";
-
-
+
+
Message message = new MessageImpl();
message.put(Message.CONTENT_TYPE, contentType);
message.setContent(InputStream.class, getClass().getResourceAsStream("cxf3582.data"));
@@ -591,12 +591,12 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/related"));
-
+
ad.initializeAttachments();
-
+
String cid = "1a66bb35-67fc-4e89-9f33-48af417bf9fe-1@apache.org";
DataSource ds = AttachmentUtil.getAttachmentDataSource(cid, message.getAttachments());
byte bts[] = new byte[1024];
@@ -631,8 +631,8 @@ public class AttachmentDeserializerTest extends Assert {
String contentType = "multipart/related; type=\"application/xop+xml\"; "
+ "boundary=\"uuid:906fa67b-85f9-4ef5-8e3d-52416022d463\"; "
+ "start=\"<ro...@cxf.apache.org>\"; start-info=\"text/xml\"";
-
-
+
+
Message message = new MessageImpl();
message.put(Message.CONTENT_TYPE, contentType);
message.setContent(InputStream.class, getClass().getResourceAsStream("cxf3582.data"));
@@ -642,12 +642,12 @@ public class AttachmentDeserializerTest extends Assert {
.valueOf(AttachmentDeserializer.THRESHOLD));
- AttachmentDeserializer ad
- = new AttachmentDeserializer(message,
+ AttachmentDeserializer ad
+ = new AttachmentDeserializer(message,
Collections.singletonList("multipart/related"));
-
+
ad.initializeAttachments();
-
+
String cid = "1a66bb35-67fc-4e89-9f33-48af417bf9fe-1@apache.org";
DataSource ds = AttachmentUtil.getAttachmentDataSource(cid, message.getAttachments());
byte bts[] = new byte[1024];