]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6843: Added support for external media with HTTPS URLs.
authorremillet <remillet@yahoo.com>
Fri, 15 Jan 2016 01:23:54 +0000 (17:23 -0800)
committerremillet <remillet@yahoo.com>
Fri, 15 Jan 2016 01:23:54 +0000 (17:23 -0800)
services/common/src/main/java/org/collectionspace/services/common/blob/BlobInput.java

index 222634c48aafc6db91fc9c1f16b6612f0bede6c3..dc9e248891a084c12985002187f15230cb7ad445 100644 (file)
@@ -180,11 +180,21 @@ public class BlobInput {
        this.setBlobUri(blobUri);
        }
        
+       private boolean isProtocolHttp(URL url) {
+               boolean result = false;
+               
+               if (url.getProtocol().equalsIgnoreCase("http") ||
+                               url.getProtocol().equalsIgnoreCase("https")) {
+                       result = true;
+               }
+               
+               return result;
+       }
+       
        public void createBlobFile(String theBlobUri) throws MalformedURLException, Exception {
                URL blobUrl = new URL(theBlobUri);
        File theBlobFile = null;
-
-               if (blobUrl.getProtocol().equalsIgnoreCase("http")) { //REM: Add support for https as well
+               if (isProtocolHttp(blobUrl) == true) {
                        Download fetchedFile = new Download(blobUrl);
                        if (logger.isDebugEnabled() == true) {
                                logger.debug("Starting blob download into temp file:" + fetchedFile.getFilePath());