You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by as...@apache.org on 2015/04/09 18:30:16 UTC
[1/4] cxf git commit: Few minor optimizations in AttachmentSerializer
Repository: cxf
Updated Branches:
refs/heads/3.0.x-fixes 2cfdd8e18 -> c26c0f711
Few minor optimizations in AttachmentSerializer
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1c8cbd98
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1c8cbd98
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1c8cbd98
Branch: refs/heads/3.0.x-fixes
Commit: 1c8cbd98259ac6a6d45e2ba58945d100bffa8d83
Parents: b46d037
Author: Alessio Soldano <as...@redhat.com>
Authored: Thu Apr 9 18:23:50 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Thu Apr 9 18:27:24 2015 +0200
----------------------------------------------------------------------
.../cxf/attachment/AttachmentSerializer.java | 33 +++++++-------------
1 file changed, 12 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/1c8cbd98/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
index 408db87..24b4766 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -72,7 +72,6 @@ public class AttachmentSerializer {
bodyBoundary = AttachmentUtil.getUniqueBoundaryValue();
String bodyCt = (String) message.get(Message.CONTENT_TYPE);
- bodyCt = bodyCt.replaceAll("\"", "\\\"");
// The bodyCt string is used enclosed within "", so if it contains the character ", it
// should be adjusted, like in the following case:
@@ -107,17 +106,15 @@ public class AttachmentSerializer {
// type is a required parameter for multipart/related only
if (xopOrMultipartRelated
&& requestMimeType.indexOf("type=") == -1) {
- ct.append("; ");
if (xop) {
- ct.append("type=\"application/xop+xml\"");
+ ct.append("; type=\"application/xop+xml\"");
} else {
- ct.append("type=\"").append(bodyCt).append("\"");
+ ct.append("; type=\"").append(bodyCt).append("\"");
}
}
// boundary
- ct.append("; ")
- .append("boundary=\"")
+ ct.append("; boundary=\"")
.append(bodyBoundary)
.append("\"");
@@ -127,8 +124,7 @@ public class AttachmentSerializer {
// for simpler multipart/related payloads but is not needed for
// multipart/mixed, multipart/form-data
if (xopOrMultipartRelated) {
- ct.append("; ")
- .append("start=\"<")
+ ct.append("; start=\"<")
.append(checkAngleBrackets(rootContentId))
.append(">\"");
}
@@ -136,8 +132,7 @@ public class AttachmentSerializer {
// start-info is a required parameter for XOP/MTOM, may be needed for
// other WS cases but is redundant in simpler multipart/related cases
if (writeOptionalTypeParameters || xop) {
- ct.append("; ")
- .append("start-info=\"")
+ ct.append("; start-info=\"")
.append(bodyCt)
.append("\"");
}
@@ -159,7 +154,7 @@ public class AttachmentSerializer {
StringBuilder mimeBodyCt = new StringBuilder();
String bodyType = getHeaderValue("Content-Type", null);
if (bodyType == null) {
- mimeBodyCt.append((xop ? "application/xop+xml" : "text/xml") + "; charset=")
+ mimeBodyCt.append(xop ? "application/xop+xml; charset=" : "text/xml; charset=")
.append(encoding)
.append("; type=\"")
.append(bodyCt)
@@ -189,12 +184,9 @@ public class AttachmentSerializer {
private static void writeHeaders(String contentType, String attachmentId,
Map<String, List<String>> headers, Writer writer) throws IOException {
- writer.write("\r\n");
- writer.write("Content-Type: ");
+ writer.write("\r\nContent-Type: ");
writer.write(contentType);
- writer.write("\r\n");
-
- writer.write("Content-Transfer-Encoding: binary\r\n");
+ writer.write("\r\nContent-Transfer-Encoding: binary\r\n");
if (attachmentId != null) {
attachmentId = checkAngleBrackets(attachmentId);
@@ -209,7 +201,8 @@ public class AttachmentSerializer {
|| "Content-Transfer-Encoding".equalsIgnoreCase(name)) {
continue;
}
- writer.write(name + ": ");
+ writer.write(name);
+ writer.write(": ");
List<String> values = entry.getValue();
for (int i = 0; i < values.size(); i++) {
writer.write(values.get(i));
@@ -238,8 +231,7 @@ public class AttachmentSerializer {
if (message.getAttachments() != null) {
for (Attachment a : message.getAttachments()) {
StringWriter writer = new StringWriter();
- writer.write("\r\n");
- writer.write("--");
+ writer.write("\r\n--");
writer.write(bodyBoundary);
Map<String, List<String>> headers = null;
@@ -265,8 +257,7 @@ public class AttachmentSerializer {
}
}
StringWriter writer = new StringWriter();
- writer.write("\r\n");
- writer.write("--");
+ writer.write("\r\n--");
writer.write(bodyBoundary);
writer.write("--");
out.write(writer.getBuffer().toString().getBytes(encoding));
[4/4] cxf git commit: Merge branch '3.0.x-fixes' of
https://git-wip-us.apache.org/repos/asf/cxf into 3.0.x
Posted by as...@apache.org.
Merge branch '3.0.x-fixes' of https://git-wip-us.apache.org/repos/asf/cxf into 3.0.x
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c26c0f71
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c26c0f71
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c26c0f71
Branch: refs/heads/3.0.x-fixes
Commit: c26c0f711aa37ccfa65f65c91c9e348d63fdf595
Parents: 15693ec 2cfdd8e
Author: Alessio Soldano <as...@redhat.com>
Authored: Thu Apr 9 18:29:55 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Thu Apr 9 18:29:55 2015 +0200
----------------------------------------------------------------------
.../java/org/apache/cxf/sts/operation/AbstractOperation.java | 8 ++++++++
.../org/apache/cxf/sts/token/canceller/SCTCanceller.java | 1 +
.../cxf/sts/token/delegation/SAMLDelegationHandler.java | 4 ++++
.../org/apache/cxf/sts/token/provider/SAMLTokenProvider.java | 1 +
.../java/org/apache/cxf/sts/token/provider/SCTProvider.java | 1 +
.../org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java | 2 +-
.../apache/cxf/sts/token/validator/SAMLTokenValidator.java | 1 +
.../org/apache/cxf/sts/token/validator/SCTValidator.java | 1 +
.../cxf/sts/token/validator/UsernameTokenValidator.java | 1 +
.../apache/cxf/sts/token/validator/X509TokenValidator.java | 1 +
10 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[2/4] cxf git commit: Use StringBuilder instead of StringBuffer
Posted by as...@apache.org.
Use StringBuilder instead of StringBuffer
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e9078e80
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e9078e80
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e9078e80
Branch: refs/heads/3.0.x-fixes
Commit: e9078e801f45e99ac9c6367fd4b5c2e028e94a18
Parents: 1c8cbd9
Author: Alessio Soldano <as...@redhat.com>
Authored: Thu Apr 9 18:27:47 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Thu Apr 9 18:27:47 2015 +0200
----------------------------------------------------------------------
.../java/org/apache/cxf/attachment/AttachmentDeserializer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e9078e80/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
index 35bdc5b..38e01ce 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
@@ -320,7 +320,7 @@ public class AttachmentDeserializer {
private Map<String, List<String>> loadPartHeaders(InputStream in) throws IOException {
List<String> headerLines = new ArrayList<String>(10);
- StringBuffer buffer = new StringBuffer(128);
+ StringBuilder buffer = new StringBuilder(128);
String line;
// loop until we hit the end or a null line
while ((line = readLine(in)) != null) {
@@ -384,7 +384,7 @@ public class AttachmentDeserializer {
}
private String readLine(InputStream in) throws IOException {
- StringBuffer buffer = new StringBuffer(128);
+ StringBuilder buffer = new StringBuilder(128);
int c;
[3/4] cxf git commit: Recording .gitmergeinfo Changes
Posted by as...@apache.org.
Recording .gitmergeinfo Changes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/15693ecf
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/15693ecf
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/15693ecf
Branch: refs/heads/3.0.x-fixes
Commit: 15693ecf4fdeb260215c71e3616aac6948a59fdc
Parents: e9078e8
Author: Alessio Soldano <as...@redhat.com>
Authored: Thu Apr 9 18:28:33 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Thu Apr 9 18:28:33 2015 +0200
----------------------------------------------------------------------
.gitmergeinfo | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/15693ecf/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 9974b0b..013eb5f 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -310,6 +310,7 @@ M cda58270486b4d394b98a1a1a1d5bfcb366af2c1
M d2dec5b87788b8cb5059d3719cf3dfd7135a1280
M d4a35c40d53fde17fec3d08c25215c7533dcb667
M d5315e072b8dd5222ede6f8e47c1e3e645209f59
+M d9f4142e87bc8a4f31c1bd1560a01a18b5c66407
M daac77b18e2693ef4ad424937aedc764229a63ee
M dbc4a26cd47c2609c601dc3640b655ea0a2b60b9
M e2225709c37cb289b99db015b3d8ba5b9b317615