private String decryptImageURLPassword(String imageUrl){
  String password=extractPasswordFromImageUrl(imageUrl);
  if (StringUtils.isNotBlank(password)) {
    String encPwd=null;
    try {
      EncryptionProviderImpl encryptionProviderImpl=new EncryptionProviderImpl();
      encryptionProviderImpl.setCoordinator(_coordinator);
      encryptionProviderImpl.start();
      EncryptionProvider encryptionProvider=encryptionProviderImpl;
      encPwd=URLEncoder.encode(encryptionProvider.decrypt(Base64.decodeBase64(password)),"UTF-8");
      return StringUtils.replace(imageUrl,":" + password + "@",":" + encPwd + "@");
    }
 catch (    UnsupportedEncodingException e) {
      log.warn("Unable to encode compute image password '{}'." + "Special characters may cause issues loading compute image.",imageUrl,e.getMessage());
    }
catch (    Exception e) {
      log.error("Cannot decrypt compute image password :" + e.getLocalizedMessage());
      e.printStackTrace();
      throw e;
    }
  }
  return imageUrl;
}

private String decryptImageURLPassword ( String imageUrl ) { String password = extractPasswordFromImageUrl ( imageUrl ) ; if ( StringUtils . isNotBlank ( password ) ) { String encPwd = null ; try { EncryptionProviderImpl encryptionProviderImpl = new EncryptionProviderImpl ( ) ; encryptionProviderImpl . setCoordinator ( _coordinator ) ; encryptionProviderImpl . start ( ) ; EncryptionProvider encryptionProvider = encryptionProviderImpl ; encPwd = URLEncoder . encode ( encryptionProvider . decrypt ( Base64 . decodeBase64 ( password ) ) , "UTF-8" ) ; return StringUtils . replace ( imageUrl , ":" + password + "@" , ":" + encPwd + "@" ) ; } catch ( UnsupportedEncodingException e ) { log . warn ( "Unable to encode compute image password '{}'." + "Special characters may cause issues loading compute image." , imageUrl , e . getMessage ( ) ) ; } catch ( Exception e ) { log . error ( "Cannot decrypt compute image password :" + e . getLocalizedMessage ( ) ) ; e . printStackTrace ( ) ; throw e ; } } return imageUrl ; }
method to decrypt the imageurl password before it can be used . this method also takes care of encoding the password before use .
