Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1210D173BD for ; Thu, 5 Feb 2015 09:58:48 +0000 (UTC) Received: (qmail 95664 invoked by uid 500); 5 Feb 2015 09:58:43 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 95630 invoked by uid 500); 5 Feb 2015 09:58:42 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 95621 invoked by uid 99); 5 Feb 2015 09:58:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2015 09:58:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C09CBE01DD; Thu, 5 Feb 2015 09:58:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to fabab54 Date: Thu, 5 Feb 2015 09:58:42 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/master d4663df7c -> fabab5460 CloudStackPrimaryDataStoreLifeCycleImpl: decode path as UTF8 or fallback Signed-off-by: Rohit Yadav (cherry picked from commit 6ddaef7a489603b058d360280fc7c4d5ec367346) Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fabab546 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fabab546 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fabab546 Branch: refs/heads/master Commit: fabab5460c6ae45f16353e3e8c31d85826c15f5e Parents: d4663df Author: Rohit Yadav Authored: Thu Feb 5 15:27:45 2015 +0530 Committer: Rohit Yadav Committed: Thu Feb 5 15:28:22 2015 +0530 ---------------------------------------------------------------------- .../CloudStackPrimaryDataStoreLifeCycleImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fabab546/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java ---------------------------------------------------------------------- diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index ae0d21b..d11342c 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -18,8 +18,10 @@ */ package org.apache.cloudstack.storage.datastore.lifecycle; +import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -182,7 +184,14 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore String scheme = uri.getScheme(); String storageHost = uri.getHost(); - String hostPath = uri.getPath(); + String hostPath = null; + try { + hostPath = URLDecoder.decode(uri.getPath(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + } + if (hostPath == null) { // if decoding fails, use getPath() anyway + hostPath = uri.getPath(); + } Object localStorage = dsInfos.get("localStorage"); if (localStorage != null) { hostPath = hostPath.replaceFirst("/", "");