test_class.file: utils/src/test/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtilTest.java
test_class.identifier: ImageStoreUtilTest
test_case.body: @Test
      public void testgeneratePostUploadUrl() throws MalformedURLException {
          String ssvmdomain = "*.realhostip.com";
          String ipAddress = "10.147.28.14";
          String uuid = UUID.randomUUID().toString();
  
          //ssvm domain is not set
          String url = ImageStoreUtil.generatePostUploadUrl(null, ipAddress, uuid);
          assertPostUploadUrl(url, ipAddress, uuid);
  
          //ssvm domain is set to empty value
          url = ImageStoreUtil.generatePostUploadUrl("", ipAddress, uuid);
          assertPostUploadUrl(url, ipAddress, uuid);
  
          //ssvm domain is set to a valid value
          url = ImageStoreUtil.generatePostUploadUrl(ssvmdomain, ipAddress, uuid);
          assertPostUploadUrl(url, ipAddress.replace(".", "-") + ssvmdomain.substring(1), uuid);
      }
test_case.class_method_signature: ImageStoreUtilTest.testgeneratePostUploadUrl()
test_case.full_signature: @Test public void testgeneratePostUploadUrl()
test_case.identifier: testgeneratePostUploadUrl
test_case.invocations: toString randomUUID generatePostUploadUrl assertPostUploadUrl generatePostUploadUrl assertPostUploadUrl generatePostUploadUrl assertPostUploadUrl replace substring
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testgeneratePostUploadUrl()
focal_class.declarator: s_logger = LoggerFactory.getLogger(ImageStoreUtil.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(ImageStoreUtil.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.file: utils/src/main/java/org/apache/cloudstack/utils/imagestore/ImageStoreUtil.java
focal_class.identifier: ImageStoreUtil
focal_class.class_method_signature: ImageStoreUtil.generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)
focal_class.full_signature: public static String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)
focal_class.identifier: generatePostUploadUrl
focal_class.modifiers: public static
focal_class.parameters: (String ssvmUrlDomain, String ipAddress, String uuid)
focal_class.return: String
focal_class.signature: String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)
focal_class.class_method_signature: ImageStoreUtil.checkTemplateFormat(String path, String uripath)
focal_class.full_signature: public static String checkTemplateFormat(String path, String uripath)
focal_class.identifier: checkTemplateFormat
focal_class.modifiers: public static
focal_class.parameters: (String path, String uripath)
focal_class.return: String
focal_class.signature: String checkTemplateFormat(String path, String uripath)
focal_class.class_method_signature: ImageStoreUtil.isCorrectExtension(String path, String ext)
focal_class.full_signature: private static boolean isCorrectExtension(String path, String ext)
focal_class.identifier: isCorrectExtension
focal_class.modifiers: private static
focal_class.parameters: (String path, String ext)
focal_class.return: boolean
focal_class.signature: boolean isCorrectExtension(String path, String ext)
focal_class.class_method_signature: ImageStoreUtil.isCompressedExtension(String path)
focal_class.full_signature: private static boolean isCompressedExtension(String path)
focal_class.identifier: isCompressedExtension
focal_class.modifiers: private static
focal_class.parameters: (String path)
focal_class.return: boolean
focal_class.signature: boolean isCompressedExtension(String path)
focal_method.body: public static String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid) {
      String hostname = ipAddress;
  
      //if ssvm url domain is present, use it to construct hostname in the format 1-2-3-4.domain
      // if the domain name is not present, ssl validation fails and has to be ignored
      if(StringUtils.isNotBlank(ssvmUrlDomain)) {
        hostname = ipAddress.replace(".", "-");
        hostname = hostname + ssvmUrlDomain.substring(1);
      }
  
      //only https works with postupload and url format is fixed
      return "https://" + hostname + "/upload/" + uuid;
    }
focal_method.class_method_signature: ImageStoreUtil.generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)
focal_method.full_signature: public static String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)
focal_method.identifier: generatePostUploadUrl
focal_method.invocations: isNotBlank replace substring
focal_method.modifiers: public static
focal_method.parameters: (String ssvmUrlDomain, String ipAddress, String uuid)
focal_method.return: String
focal_method.signature: String generatePostUploadUrl(String ssvmUrlDomain, String ipAddress, String uuid)