Class RepositoryCloneStrategyUtils
java.lang.Object
com.atlassian.bamboo.repository.git.RepositoryCloneStrategyUtils
Utility class to assist defining the Git repository cloning strategy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull String
getCloneStrategy
(@NotNull Map<String, Object> config, @NotNull String useFullClonesKey, @NotNull String useRemoteAgentCacheKey, @NotNull String useShallowClonesKey) Determines the clone strategy based on the provided configuration mapstatic @NotNull List<NameValuePair>
getCloneStrategyOptions
(@NotNull com.atlassian.sal.api.message.I18nResolver i18nResolver, @NotNull String useFullClonesKey, @NotNull String useShallowClonesKey) Retrieves a list of clone strategy options as NameValuePair objectsstatic void
setCloneStrategy
(@NotNull ActionParametersMap actionParametersMap, @NotNull Map<String, String> cfgMap, @NotNull String cloneStrategyKey, @NotNull String cloneStrategyFullCloneKey, @NotNull String useRemoteAgentCacheKey, @NotNull String useShallowClonesKey) Sets the clone strategy in the given configuration map based on the provided action parameters
-
Constructor Details
-
RepositoryCloneStrategyUtils
public RepositoryCloneStrategyUtils()
-
-
Method Details
-
getCloneStrategy
@NotNull public static @NotNull String getCloneStrategy(@NotNull @NotNull Map<String, Object> config, @NotNull @NotNull String useFullClonesKey, @NotNull @NotNull String useRemoteAgentCacheKey, @NotNull @NotNull String useShallowClonesKey) Determines the clone strategy based on the provided configuration map- Parameters:
config
- A map containing configuration settingsuseFullClonesKey
- Key for the full clones settinguseRemoteAgentCacheKey
- Key for the remote agent cache settinguseShallowClonesKey
- Key for the shallow clones setting- Returns:
- The clone strategy as a string
-
setCloneStrategy
public static void setCloneStrategy(@NotNull @NotNull ActionParametersMap actionParametersMap, @NotNull @NotNull Map<String, String> cfgMap, @NotNull @NotNull String cloneStrategyKey, @NotNull @NotNull String cloneStrategyFullCloneKey, @NotNull @NotNull String useRemoteAgentCacheKey, @NotNull @NotNull String useShallowClonesKey) Sets the clone strategy in the given configuration map based on the provided action parameters- Parameters:
actionParametersMap
- The map containing action parameters, including the clone strategycfgMap
- The configuration map to be updated with the proper clone strategy settingscloneStrategyKey
- Key for the clone strategy settingcloneStrategyFullCloneKey
- Key for the full clone strategy settinguseRemoteAgentCacheKey
- Key for the remote agent cache settinguseShallowClonesKey
- Key for the shallow clones setting
-
getCloneStrategyOptions
@NotNull public static @NotNull List<NameValuePair> getCloneStrategyOptions(@NotNull @NotNull com.atlassian.sal.api.message.I18nResolver i18nResolver, @NotNull @NotNull String useFullClonesKey, @NotNull @NotNull String useShallowClonesKey) Retrieves a list of clone strategy options as NameValuePair objects- Parameters:
i18nResolver
- The i18n resolver for localisationuseFullClonesKey
- The default clone strategy none keyuseShallowClonesKey
- Key for the shallow clones- Returns:
- A list of NameValuePair objects representing each clone strategy option
-