java.lang.Object
com.microsoftopentechnologies.windowsazurestorage.helper.Utils

public final class Utils extends Object
  • Field Details

  • Method Details

    • validateContainerName

      public static boolean validateContainerName(String containerName)
      Checks for validity of container name after converting the input into lowercase. Rules for container name 1.Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character. 2.Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names. 3.All letters in a container name must be lowercase. 4.Container names must be from 3 through 63 characters long. 5.Root container and web container are specially treated.
      Parameters:
      containerName - Name of the Azure storage container
      Returns:
      true if container name is valid else returns false
    • validateFileShareName

      public static boolean validateFileShareName(String fileShareName)
      Check for the validity of file share name. Rules: 1. must be from 3 through 63 characters long 2. can contain only lowercase letters, numbers, and hyphens 3. must begin and end with a letter or a number. 4. cannot contain two consecutive hyphens.
      Parameters:
      fileShareName -
      Returns:
    • validateBlobName

      public static boolean validateBlobName(String blobName)
    • containTokens

      public static boolean containTokens(String text)
      This method checks if text contains tokens in the form of $TOKEN or ${TOKEN}.
      Parameters:
      text -
      Returns:
      true if tokens exist in input string
    • getBlobEP

      public static String getBlobEP(String blobURL)
      Returns formatted blob end point in case if a non-default one is specified.
      Parameters:
      blobURL -
      Returns:
      DEF_BLOB_URL if blobURL is empty or blobURL is default one else returns formatted blob url.
    • getDefaultBlobURL

      public static String getDefaultBlobURL()
      Returns default blob url.
      Returns:
    • getMD5

      public static String getMD5(String plainText)
      Returns md5 hash in string format for a given string.
      Parameters:
      plainText -
      Returns:
    • getWorkDirectory

      public static String getWorkDirectory()
    • getPluginInstance

      public static String getPluginInstance()
    • getPluginVersion

      public static String getPluginVersion()
    • replaceMacro

      public static String replaceMacro(String s, Map<String,String> props, Locale locale)
      wrapper of method Util.replaceMacro(String, Map), make the result into lower case.
      Parameters:
      s -
      props -
      locale -
      Returns:
    • replaceMacro

      public static String replaceMacro(String s, Map<String,String> props)
      wrapper of method Util.replaceMacro(String, Map), trim the result.
      Parameters:
      s -
      props -
      Returns: