Package org.jenkinsci.plugins.fodupload
Class Utils
- java.lang.Object
-
- org.jenkinsci.plugins.fodupload.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringFOD_APIURL_ERROR_MESSAGEprotected static StringFOD_BASEURL_ERROR_MESSAGEprotected static StringFOD_URL_ERROR_MESSAGE
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcreateCorrelationId()static <T> StringcreateResponseViewModel(T response)static FilecreateZipFile(String techStack, FilePath payload, PrintStream logger)Zips a folder, stores it in a temp location and returns the objectstatic Stringdecrypt(Secret stringToDecrypt)static Stringdecrypt(String stringToDecrypt)static Stringencrypt(String stringToEncrypt)static AuthenticationModelgetAuthModelFromObject(net.sf.json.JSONObject authModelObject)static StringgetFileExpressionPatternString(String technologyStack)static StringgetLogTimestampFormat()static booleanisCredential(String id)static booleanisEncrypted(String stringToEncrypt)static booleanisNullOrEmpty(String string)static booleanisNullOrEmpty(List list)static BooleanisUnauthorizedResponse(ResponseContent response)static <E extends Enum<E> & IFodEnum>
BooleanisValidEnumValue(Class<E> enumClass, String value)static StringisValidUrl(String url)static voidlogger(PrintStream printStream, String msg)static StringretrieveSecretDecryptedValue(String id)static booleantraceLogging()static inttryParseInt(String value)static IntegertryParseInt(String value, Integer defaultValue)static List<String>unauthorizedServerResponseErrors()static List<String>unexpectedServerResponseErrors()
-
-
-
Field Detail
-
FOD_URL_ERROR_MESSAGE
protected static final String FOD_URL_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
FOD_BASEURL_ERROR_MESSAGE
protected static final String FOD_BASEURL_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
FOD_APIURL_ERROR_MESSAGE
protected static final String FOD_APIURL_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
tryParseInt
public static int tryParseInt(String value)
-
isNullOrEmpty
public static boolean isNullOrEmpty(List list)
-
isNullOrEmpty
public static boolean isNullOrEmpty(String string)
-
getFileExpressionPatternString
public static String getFileExpressionPatternString(String technologyStack)
-
createZipFile
public static File createZipFile(String techStack, FilePath payload, PrintStream logger) throws IOException
Zips a folder, stores it in a temp location and returns the object- Parameters:
techStack- technology stack of the folder to zippayload- location of the files to ziplogger- logger to write status text to at_return a File object- Throws:
IOException- no files
-
isEncrypted
public static boolean isEncrypted(String stringToEncrypt)
-
isCredential
public static boolean isCredential(String id)
-
isUnauthorizedResponse
public static Boolean isUnauthorizedResponse(ResponseContent response)
-
createResponseViewModel
public static <T> String createResponseViewModel(T response)
-
createCorrelationId
public static String createCorrelationId()
-
getAuthModelFromObject
public static AuthenticationModel getAuthModelFromObject(net.sf.json.JSONObject authModelObject)
-
isValidEnumValue
public static <E extends Enum<E> & IFodEnum> Boolean isValidEnumValue(Class<E> enumClass, String value)
-
getLogTimestampFormat
public static String getLogTimestampFormat()
-
traceLogging
public static boolean traceLogging()
-
logger
public static void logger(PrintStream printStream, String msg)
-
-