Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31211EB41 for ; Tue, 28 May 2013 14:49:24 +0000 (UTC) Received: (qmail 50589 invoked by uid 500); 28 May 2013 14:49:23 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 50478 invoked by uid 500); 28 May 2013 14:49:23 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 50454 invoked by uid 99); 28 May 2013 14:49:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 14:49:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 14:49:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0C06923889DE for ; Tue, 28 May 2013 14:48:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1486942 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/Request.java java/org/apache/catalina/core/ApplicationPart.java webapps/docs/changelog.xml Date: Tue, 28 May 2013 14:48:58 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130528144859.0C06923889DE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Tue May 28 14:48:58 2013 New Revision: 1486942 URL: http://svn.apache.org/r1486942 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54971 Pass the calculated location to AplicationPart rather than it having to recalculate it every time. Now correctly handles relative locations. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationPart.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1486939 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java?rev=1486942&r1=1486941&r2=1486942&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Request.java Tue May 28 14:48:58 2013 @@ -2733,7 +2733,7 @@ public class Request } } for (FileItem item : items) { - ApplicationPart part = new ApplicationPart(item, mce); + ApplicationPart part = new ApplicationPart(item, location); parts.add(part); if (part.getSubmittedFileName() == null) { String name = part.getName(); Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationPart.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationPart.java?rev=1486942&r1=1486941&r2=1486942&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationPart.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ApplicationPart.java Tue May 28 14:48:58 2013 @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.catalina.core; import java.io.File; @@ -28,7 +27,6 @@ import java.util.Iterator; import java.util.Locale; import java.util.Map; -import javax.servlet.MultipartConfigElement; import javax.servlet.http.Part; import org.apache.tomcat.util.http.fileupload.FileItem; @@ -42,12 +40,12 @@ import org.apache.tomcat.util.http.fileu */ public class ApplicationPart implements Part { - private FileItem fileItem; - private MultipartConfigElement mce; + private final FileItem fileItem; + private final File location; - public ApplicationPart(FileItem fileItem, MultipartConfigElement mce) { + public ApplicationPart(FileItem fileItem, File location) { this.fileItem = fileItem; - this.mce = mce; + this.location = location; } @Override @@ -115,7 +113,7 @@ public class ApplicationPart implements public void write(String fileName) throws IOException { File file = new File(fileName); if (!file.isAbsolute()) { - file = new File(mce.getLocation(), fileName); + file = new File(location, fileName); } try { fileItem.write(file); Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1486942&r1=1486941&r2=1486942&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue May 28 14:48:58 2013 @@ -84,6 +84,10 @@ response. (violetagg) + 54971: Ensure that the correct location is used when writing + files via avax.servlet.http.Part.write(String). (markt) + + 54974: Ensure that SessionCookieConfig#set<methods> will throw IllegalStateException if the --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org