Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload f70a2a148 -> 36c0c38ab


volume upload: added the url validation check when url is not null


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/36c0c38a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/36c0c38a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/36c0c38a

Branch: refs/heads/volume-upload
Commit: 36c0c38ab8294a222b25f6d7f6e5c8e80cc3aec2
Parents: f70a2a1
Author: Rajani Karuturi <rajanikarut...@gmail.com>
Authored: Tue Dec 16 15:41:27 2014 +0530
Committer: Rajani Karuturi <rajanikarut...@gmail.com>
Committed: Tue Dec 16 15:41:27 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/template/TemplateAdapterBase.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/36c0c38a/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java 
b/server/src/com/cloud/template/TemplateAdapterBase.java
index 960f193..e70683b 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -183,10 +183,10 @@ public abstract class TemplateAdapterBase extends 
AdapterBase implements Templat
             throw new InvalidParameterValueException("Please specify a valid 
zone Id. Only admins can create templates in all zones.");
         }
 
-        //TODO: commenting it for post upload to work as it doesnt have an 
url. Need to figure out how to resolve this
-//        if (url.toLowerCase().contains("file://")) {
-//            throw new InvalidParameterValueException("File:// type urls are 
currently unsupported");
-//        }
+        // check for the url format only when url is not null. url can be null 
incase of form based upload
+        if (url != null && url.toLowerCase().contains("file://")) {
+            throw new InvalidParameterValueException("File:// type urls are 
currently unsupported");
+        }
 
         // check whether owner can create public templates
         boolean allowPublicUserTemplates = 
TemplateManager.AllowPublicUserTemplates.valueIn(templateOwner.getId());

Reply via email to