From: mka Date: Mon, 8 Apr 2013 08:48:46 +0000 (+0000) Subject: Upload operation is improved(Files that name contains the special symbols(ex, &)... X-Git-Tag: Root_Delivery2_2013_04_22~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20fc9751df2b6577e83f789db871fe71608fb8bf;p=tools%2Fsiman.git Upload operation is improved(Files that name contains the special symbols(ex, &) can also be uploaded now) --- diff --git a/Workspace/Siman/src/org/splat/simer/UploadAction.java b/Workspace/Siman/src/org/splat/simer/UploadAction.java index a5548dd..1814bce 100644 --- a/Workspace/Siman/src/org/splat/simer/UploadAction.java +++ b/Workspace/Siman/src/org/splat/simer/UploadAction.java @@ -1,6 +1,8 @@ package org.splat.simer; import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import org.splat.kernel.Do; import org.splat.service.technical.RepositoryService; @@ -162,6 +164,20 @@ public class UploadAction extends Action { return _uploadFileName; } + /** + * Get fileName with url special symbols canceled for usage in struts.xml. + * @return + */ + public String getCanceledFileName() { + String res = _uploadFileName; + try { + res = URLEncoder.encode(res, "UTF-8"); + } catch (UnsupportedEncodingException e) { + LOG.error("Reason: ", e); + } + return res; + } + /** * Get the action to which the uploaded file is passed. * diff --git a/Workspace/Siman/src/struts.xml b/Workspace/Siman/src/struts.xml index 1c31962..8d6c00d 100644 --- a/Workspace/Siman/src/struts.xml +++ b/Workspace/Siman/src/struts.xml @@ -490,13 +490,13 @@ step-study - import-document?fileName=%{fileName} + import-document?fileName=%{canceledFileName} - version-document?index=%{index}&fileName=%{fileName} + version-document?index=%{index}&fileName=%{canceledFileName} - attach-document?index=%{index}&fileName=%{fileName} + attach-document?index=%{index}&fileName=%{canceledFileName} page.error.study