Repository: camel Updated Branches: refs/heads/master 1175b2752 -> a97c6421b
Fixed CS errors of camel-jetty9 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a97c6421 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a97c6421 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a97c6421 Branch: refs/heads/master Commit: a97c6421ba4dc12a03fa84f66094e92f68182148 Parents: 1175b27 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Mon Feb 2 12:42:27 2015 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Mon Feb 2 12:42:27 2015 +0800 ---------------------------------------------------------------------- .../component/jetty9/AttachmentHttpBinding.java | 47 +++++++++++++------- .../component/jetty9/JettyHttpEndpoint9.java | 16 +++++++ 2 files changed, 47 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a97c6421/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java index 82ce70f..14e45a9 100644 --- a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java +++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.camel.component.jetty9; import java.io.IOException; @@ -24,24 +40,23 @@ final class AttachmentHttpBinding extends DefaultHttpBinding { protected void populateAttachments(HttpServletRequest request, HttpMessage message) { Object object = request.getAttribute("org.eclipse.jetty.servlet.MultiPartFile.multiPartInputStream"); if (object instanceof MultiPartInputStreamParser) { - MultiPartInputStreamParser parser = (MultiPartInputStreamParser)object; - Collection<Part> parts; - try { - parts = parser.getParts(); - for (Part part : parts) { - String contentType = part.getContentType(); - if (!contentType.startsWith("application/octet-stream")) { - continue; - } - - DataSource ds = new PartDataSource(part); - message.addAttachment(part.getName(), new DataHandler(ds)); + MultiPartInputStreamParser parser = (MultiPartInputStreamParser)object; + Collection<Part> parts; + try { + parts = parser.getParts(); + for (Part part : parts) { + String contentType = part.getContentType(); + if (!contentType.startsWith("application/octet-stream")) { + continue; } - } catch (Exception e) { - e.printStackTrace(); + + DataSource ds = new PartDataSource(part); + message.addAttachment(part.getName(), new DataHandler(ds)); } - - + } catch (Exception e) { + e.printStackTrace(); + } + } } http://git-wip-us.apache.org/repos/asf/camel/blob/a97c6421/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java ---------------------------------------------------------------------- diff --git a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java index 9c5ac6a..9ead2b1 100644 --- a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java +++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/JettyHttpEndpoint9.java @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.camel.component.jetty9; import java.net.URI;