com.microsoftopentechnologies.windowsazurestorage.helper
Class Utils

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

public class Utils
extends Object


Field Summary
static String DEF_BLOB_URL
           
static String FWD_SLASH
           
static String HTTP_PRT
           
static String PRT_SEP
           
static String TOKEN_FORMAT
           
static String VAL_CNT_NAME
           
 
Constructor Summary
Utils()
           
 
Method Summary
static boolean containTokens(String text)
          This method checks if text contains tokens in the form of $TOKEN or ${TOKEN}
static String getBlobEP(String storageAccName, String blobURL)
          Returns formatted blob end point in case if a non-default one is specified.
static String getDefaultBlobURL()
          Returns default blob url
static boolean isNullOrEmpty(String name)
          Utility method to check for null conditions or empty strings.
static String removeTokens(String text)
          This method find tokens in the form of $TOKEN or ${TOKEN} and removes them
static String replaceTokens(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener, String text)
          Utility method to replace system environment variables in text
static boolean validateContainerName(String containerName)
          Checks for validity of container name after converting the input into lowercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VAL_CNT_NAME

public static final String VAL_CNT_NAME
See Also:
Constant Field Values

TOKEN_FORMAT

public static final String TOKEN_FORMAT
See Also:
Constant Field Values

DEF_BLOB_URL

public static final String DEF_BLOB_URL
See Also:
Constant Field Values

FWD_SLASH

public static final String FWD_SLASH
See Also:
Constant Field Values

HTTP_PRT

public static final String HTTP_PRT
See Also:
Constant Field Values

PRT_SEP

public static final String PRT_SEP
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

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.

Parameters:
containerName - Name of the Windows Azure storage container
Returns:
true if conatiner name is valid else returns false

isNullOrEmpty

public static boolean isNullOrEmpty(String name)
Utility method to check for null conditions or empty strings.

Parameters:
name -
Returns:
true if null or empty string

replaceTokens

public static String replaceTokens(hudson.model.AbstractBuild<?,?> build,
                                   hudson.model.BuildListener listener,
                                   String text)
                            throws IOException,
                                   InterruptedException
Utility method to replace system environment variables in text

Parameters:
build -
listener -
text -
Returns:
Throws:
InterruptedException
IOException

removeTokens

public static String removeTokens(String text)
This method find tokens in the form of $TOKEN or ${TOKEN} and removes them

Parameters:
text - may contains tokens that are to be replaced
Returns:
String replaced text

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 storageAccName,
                               String blobURL)
Returns formatted blob end point in case if a non-default one is specified.

Parameters:
storageAccName -
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:


Copyright © 2004-2014. All Rights Reserved.