Class FilenameChoiceListProvider
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ChoiceListProvider>
-
- jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
-
- jp.ikedam.jenkins.plugins.extensible_choice_parameter.FilenameChoiceListProvider
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ChoiceListProvider>
,Serializable
public class FilenameChoiceListProvider extends ChoiceListProvider
Create a choice list from a list of files.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FilenameChoiceListProvider.DescriptorImpl
Class for view.static class
FilenameChoiceListProvider.EmptyChoiceType
static class
FilenameChoiceListProvider.ScanType
A type specifying what type of files to scan to list.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType)
FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder)
Deprecated.FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder, FilenameChoiceListProvider.EmptyChoiceType emptyChoiceType)
The constructor called when a user posts a form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected File
getBaseDir()
Returns a directory to scan for files.protected static File
getBaseDir(String baseDirPath)
Returns a directory to scan for files from the passed path.String
getBaseDirPath()
Returns a path to a directory to scan for files.List<String>
getChoiceList()
Returns the list of choices to show.FilenameChoiceListProvider.EmptyChoiceType
getEmptyChoiceType()
String
getExcludePattern()
Returns a pattern for files to exclude.protected static List<String>
getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType)
Deprecated.protected static List<String>
getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder)
Deprecated.protected static List<String>
getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder, FilenameChoiceListProvider.EmptyChoiceType emptyChoiceType)
List files from passed parameters.String
getIncludePattern()
Returns a pattern for files to include.FilenameChoiceListProvider.ScanType
getScanType()
Returns what type of files to list.boolean
isReverseOrder()
-
Methods inherited from class jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
all, getDefaultChoice, onBuildCompletedWithValue, onBuildTriggeredWithValue, requiresBuildPermission
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
FilenameChoiceListProvider
@DataBoundConstructor public FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder, FilenameChoiceListProvider.EmptyChoiceType emptyChoiceType)
The constructor called when a user posts a form.- Parameters:
baseDirPath
- a path to the directory to scan.includePattern
- a pattern of file names to include to the list.excludePattern
- a pattern of file names to exclude from the list.scanType
- a type of files to list.emptyChoiceType
- whether and where to put an empty choice.
-
FilenameChoiceListProvider
@Deprecated public FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder)
Deprecated.
-
FilenameChoiceListProvider
@Deprecated public FilenameChoiceListProvider(String baseDirPath, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType)
For backward compatibility.- Parameters:
baseDirPath
-includePattern
-excludePattern
-scanType
-
-
-
Method Detail
-
getBaseDirPath
public String getBaseDirPath()
Returns a path to a directory to scan for files. If this path is absolute, it is used as specified. If this path is relative, it is considered relative from JENKINS_HOME.- Returns:
- the baseDirPath
-
getBaseDir
protected static File getBaseDir(String baseDirPath)
Returns a directory to scan for files from the passed path. Whether the path is relative or absolute, is resolved here.- Parameters:
baseDirPath
- a path string to the directory.- Returns:
- A file object specifying the proper path of the directory.
-
getBaseDir
protected File getBaseDir()
Returns a directory to scan for files.- Returns:
- A file object specifying the proper path to the directory to scan.
-
getIncludePattern
public String getIncludePattern()
Returns a pattern for files to include.- Returns:
- the include pattern
-
getScanType
public FilenameChoiceListProvider.ScanType getScanType()
Returns what type of files to list.- Returns:
- what type of files to list
-
getExcludePattern
public String getExcludePattern()
Returns a pattern for files to exclude.- Returns:
- the exclude pattern
-
isReverseOrder
public boolean isReverseOrder()
- Returns:
-
getEmptyChoiceType
public FilenameChoiceListProvider.EmptyChoiceType getEmptyChoiceType()
- Returns:
- whether and where to put an empty choice.
-
getFileList
protected static List<String> getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder, FilenameChoiceListProvider.EmptyChoiceType emptyChoiceType)
List files from passed parameters.- Parameters:
baseDir
-includePattern
-excludePattern
-scanType
-reverseOrder
-- Returns:
-
getFileList
@Deprecated protected static List<String> getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType, boolean reverseOrder)
Deprecated.
-
getFileList
@Deprecated protected static List<String> getFileList(File baseDir, String includePattern, String excludePattern, FilenameChoiceListProvider.ScanType scanType)
Deprecated.For backward compatibility.- Parameters:
baseDir
-includePattern
-excludePattern
-scanType
-- Returns:
-
getChoiceList
public List<String> getChoiceList()
Returns the list of choices to show.- Specified by:
getChoiceList
in classChoiceListProvider
- Returns:
- See Also:
ChoiceListProvider.getChoiceList()
-
-