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 String
FOD_APIURL_ERROR_MESSAGE
protected static String
FOD_BASEURL_ERROR_MESSAGE
protected static String
FOD_URL_ERROR_MESSAGE
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createCorrelationId()
static <T> String
createResponseViewModel(T response)
static File
createZipFile(String techStack, FilePath payload, PrintStream logger)
Zips a folder, stores it in a temp location and returns the objectstatic String
decrypt(Secret stringToDecrypt)
static String
decrypt(String stringToDecrypt)
static String
encrypt(String stringToEncrypt)
static AuthenticationModel
getAuthModelFromObject(net.sf.json.JSONObject authModelObject)
static String
getFileExpressionPatternString(String technologyStack)
static String
getLogTimestampFormat()
static boolean
isCredential(String id)
static boolean
isEncrypted(String stringToEncrypt)
static boolean
isNullOrEmpty(String string)
static boolean
isNullOrEmpty(List list)
static Boolean
isUnauthorizedResponse(ResponseContent response)
static <E extends Enum<E> & IFodEnum>
BooleanisValidEnumValue(Class<E> enumClass, String value)
static String
isValidUrl(String url)
static void
logger(PrintStream printStream, String msg)
static String
retrieveSecretDecryptedValue(String id)
static boolean
traceLogging()
static int
tryParseInt(String value)
static Integer
tryParseInt(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)
-
-