CLOUDSTACK-6940:Templates cannot be downloaded from URLs without

matching file extensions.
This commit is contained in:
Min Chen 2014-06-18 15:47:57 -07:00
parent ce3550f333
commit 569e94908b
1 changed files with 0 additions and 16 deletions

View File

@ -16,8 +16,6 @@
// under the License.
package com.cloud.template;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@ -130,20 +128,6 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
public TemplateProfile prepare(RegisterTemplateCmd cmd) throws ResourceAllocationException {
TemplateProfile profile = super.prepare(cmd);
String url = profile.getUrl();
String path = null;
try {
URL str = new URL(url);
path = str.getPath();
} catch (MalformedURLException ex) {
throw new InvalidParameterValueException("Please specify a valid URL. URL:" + url + " is invalid");
}
try {
checkFormat(cmd.getFormat(), url);
} catch (InvalidParameterValueException ex) {
checkFormat(cmd.getFormat(), path);
}
UriUtils.validateUrl(url);
profile.setUrl(url);
// Check that the resource limit for secondary storage won't be exceeded