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 String
APP_NAME
static String
ATTR_CLEANUP_ON_FAIL
static String
ATTR_EXECUTABLE
static String
ATTR_FAIL_ON_ERROR
static String
ATTR_HELP_ARGS
static String
ATTR_HELP_DEFAULT
static String
ATTR_HELP_EXAMPLES
static String
ATTR_HELP_SUCCESS
static String
ATTR_PREPROCESS
static String
ATTR_TYPE
static String
ATTR_UPDATEABLE
static String
ATTR_VERSION_DESCRIPTION
static String
ATTR_VERSION_FILE
static String
ATTR_VERSION_NAME
static String
ATTR_VERSION_NOTES
static String
DIRECTORIES
static String
FILES
static String
HELP_SET
static String
IGNORED_FILES
static String
PERMISSIONS_FILES
static String
SOURCE_FILE
static String
SOURCE_URL
static String
TARGET_DIRECTORY
static String
TARGET_FILE
static String
TYPE_FILE_SET
static String
TYPE_SETUP
static String
TYPE_ZIP
static String
VERSION_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 void
doSetup(Map map)
protected SingleSourceSet
doSingleDirectoryCase(Map map, String type)
the YAML file may have a single directory or a list of them.static Boolean
getBoolean(Map map, String key)
This grabs the boolean value from a map.InstallConfiguration
getInstallConfiguration()
protected List
getList(Map map, String key)
protected Map
getMap(Map map, String key)
return the entry of the current configuration map cast to a mapprotected String
getString(Map map, String key)
void
initDirs(List dirs)
protected void
initSetup(List setup)
protected String
loadHelpFile(Map helpMap, String keyName)
static void
main(String[] args)
Just for testing.protected void
processDirectories(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
-
-
-