test_class.file: cosmic-common/src/test/java/com/cloud/utils/imagestore/ImageStoreUtilTest.java
test_class.identifier: ImageStoreUtilTest
test_case.body: @Test
      public void testgeneratePostUploadUrl() throws MalformedURLException {
          final String ssvmdomain = "*.realhostip.com";
          final String ipAddress = "10.147.28.14";
          final 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: cosmic-common/src/main/java/com/cloud/utils/imagestore/ImageStoreUtil.java
focal_class.identifier: ImageStoreUtil
focal_class.class_method_signature: ImageStoreUtil.generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_class.full_signature: public static String generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_class.identifier: generatePostUploadUrl
focal_class.modifiers: public static
focal_class.parameters: (final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_class.return: String
focal_class.signature: String generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_class.class_method_signature: ImageStoreUtil.checkTemplateFormat(final String path, final String uripath)
focal_class.full_signature: public static String checkTemplateFormat(final String path, final String uripath)
focal_class.identifier: checkTemplateFormat
focal_class.modifiers: public static
focal_class.parameters: (final String path, final String uripath)
focal_class.return: String
focal_class.signature: String checkTemplateFormat(final String path, final String uripath)
focal_class.class_method_signature: ImageStoreUtil.isCompressedExtension(final String path)
focal_class.full_signature: private static boolean isCompressedExtension(final String path)
focal_class.identifier: isCompressedExtension
focal_class.modifiers: private static
focal_class.parameters: (final String path)
focal_class.return: boolean
focal_class.signature: boolean isCompressedExtension(final String path)
focal_class.class_method_signature: ImageStoreUtil.isCorrectExtension(final String path, final String ext)
focal_class.full_signature: private static boolean isCorrectExtension(final String path, final String ext)
focal_class.identifier: isCorrectExtension
focal_class.modifiers: private static
focal_class.parameters: (final String path, final String ext)
focal_class.return: boolean
focal_class.signature: boolean isCorrectExtension(final String path, final String ext)
focal_method.body: public static String generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final 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(final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_method.full_signature: public static String generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_method.identifier: generatePostUploadUrl
focal_method.invocations: isNotBlank replace substring
focal_method.modifiers: public static
focal_method.parameters: (final String ssvmUrlDomain, final String ipAddress, final String uuid)
focal_method.return: String
focal_method.signature: String generatePostUploadUrl(final String ssvmUrlDomain, final String ipAddress, final String uuid)