Package edu.uiuc.ncsa.security.installer
Class InstallConfigurationImporter
- java.lang.Object
-
- edu.uiuc.ncsa.security.installer.InstallConfigurationImporter
-
public class InstallConfigurationImporter extends Object
Does the grunt work of importing from a configuration file.Created by Jeff Gaynor
on 6/14/24 at 7:25 AM
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_NAMEstatic StringATTR_CLEANUP_ON_FAILstatic StringATTR_EXECUTABLEstatic StringATTR_FAIL_ON_ERRORstatic StringATTR_HELP_ARGSstatic StringATTR_HELP_DEFAULTstatic StringATTR_HELP_EXAMPLESstatic StringATTR_HELP_SUCCESSstatic StringATTR_PREPROCESSstatic StringATTR_TYPEstatic StringATTR_UPDATEABLEstatic StringATTR_VERSION_DESCRIPTIONstatic StringATTR_VERSION_FILEstatic StringATTR_VERSION_NAMEstatic StringATTR_VERSION_NOTESstatic StringDIRECTORIESstatic StringFILESstatic StringHELP_SETstatic StringIGNORED_FILESstatic StringPERMISSIONS_FILESstatic StringSOURCE_FILEstatic StringSOURCE_URLstatic StringTARGET_DIRECTORYstatic StringTARGET_FILEstatic StringTYPE_FILE_SETstatic StringTYPE_SETUPstatic StringTYPE_ZIPstatic StringVERSION_SET
-
Constructor Summary
Constructors Constructor Description InstallConfigurationImporter(List setup)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoSetup(Map map)protected SingleSourceSetdoSingleDirectoryCase(Map map, String type)the YAML file may have a single directory or a list of them.static BooleangetBoolean(Map map, String key)This grabs the boolean value from a map.InstallConfigurationgetInstallConfiguration()protected ListgetList(Map map, String key)protected MapgetMap(Map map, String key)return the entry of the current configuration map cast to a mapprotected StringgetString(Map map, String key)voidinitDirs(List dirs)protected voidinitSetup(List setup)protected StringloadHelpFile(Map helpMap, String keyName)static voidmain(String[] args)Just for testing.protected voidprocessDirectories(SingleSourceSet singleSourceSet, List dirList, String type)The directories entry contains a list of directoriesprotected List<FileEntryInterface>processFileEntries(List list)protected List<FileEntryInterface>processJarEntries(List list)
-
-
-
Field Detail
-
SOURCE_URL
public static String SOURCE_URL
-
DIRECTORIES
public static String DIRECTORIES
-
FILES
public static String FILES
-
IGNORED_FILES
public static String IGNORED_FILES
-
PERMISSIONS_FILES
public static String PERMISSIONS_FILES
-
SOURCE_FILE
public static String SOURCE_FILE
-
TARGET_FILE
public static String TARGET_FILE
-
TARGET_DIRECTORY
public static String TARGET_DIRECTORY
-
ATTR_PREPROCESS
public static String ATTR_PREPROCESS
-
ATTR_EXECUTABLE
public static String ATTR_EXECUTABLE
-
ATTR_UPDATEABLE
public static String ATTR_UPDATEABLE
-
ATTR_TYPE
public static String ATTR_TYPE
-
TYPE_SETUP
public static String TYPE_SETUP
-
TYPE_FILE_SET
public static String TYPE_FILE_SET
-
TYPE_ZIP
public static String TYPE_ZIP
-
APP_NAME
public static final String APP_NAME
- See Also:
- Constant Field Values
-
HELP_SET
public static final String HELP_SET
- See Also:
- Constant Field Values
-
VERSION_SET
public static final String VERSION_SET
- See Also:
- Constant Field Values
-
ATTR_FAIL_ON_ERROR
public static final String ATTR_FAIL_ON_ERROR
- See Also:
- Constant Field Values
-
ATTR_CLEANUP_ON_FAIL
public static final String ATTR_CLEANUP_ON_FAIL
- See Also:
- Constant Field Values
-
ATTR_VERSION_FILE
public static final String ATTR_VERSION_FILE
- See Also:
- Constant Field Values
-
ATTR_VERSION_NAME
public static final String ATTR_VERSION_NAME
- See Also:
- Constant Field Values
-
ATTR_VERSION_DESCRIPTION
public static final String ATTR_VERSION_DESCRIPTION
- See Also:
- Constant Field Values
-
ATTR_VERSION_NOTES
public static final String ATTR_VERSION_NOTES
- See Also:
- Constant Field Values
-
ATTR_HELP_ARGS
public static final String ATTR_HELP_ARGS
- See Also:
- Constant Field Values
-
ATTR_HELP_DEFAULT
public static final String ATTR_HELP_DEFAULT
- See Also:
- Constant Field Values
-
ATTR_HELP_EXAMPLES
public static final String ATTR_HELP_EXAMPLES
- See Also:
- Constant Field Values
-
ATTR_HELP_SUCCESS
public static final String ATTR_HELP_SUCCESS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InstallConfigurationImporter
public InstallConfigurationImporter(List setup)
-
-
Method Detail
-
initSetup
protected void initSetup(List setup)
-
initDirs
public void initDirs(List dirs)
-
doSetup
protected void doSetup(Map map)
-
loadHelpFile
protected String loadHelpFile(Map helpMap, String keyName) throws IOException
- Throws:
IOException
-
doSingleDirectoryCase
protected SingleSourceSet doSingleDirectoryCase(Map map, String type)
the YAML file may have a single directory or a list of them. This processes the case that the top-level element is just a directory
-
processDirectories
protected void processDirectories(SingleSourceSet singleSourceSet, List dirList, String type)
The directories entry contains a list of directories- Parameters:
dirList-
-
processJarEntries
protected List<FileEntryInterface> processJarEntries(List list)
-
processFileEntries
protected List<FileEntryInterface> processFileEntries(List list)
-
getBoolean
public static Boolean getBoolean(Map map, String key)
This grabs the boolean value from a map. Note that this is more complex than it would seem.Boolean.parseBoolean(String)always returns, and if the argument is gibberish, it just returns false. We need the values to be true, false or null (showing unset).- Parameters:
map-key-- Returns:
-
getMap
protected Map getMap(Map map, String key)
return the entry of the current configuration map cast to a map- Parameters:
key-- Returns:
-
getInstallConfiguration
public InstallConfiguration getInstallConfiguration()
-
main
public static void main(String[] args)
Just for testing. Only loads everything into an instance of this object.- Parameters:
args-
-
-