Package io.jenkins.plugins.dotnet.data
Class Downloads
java.lang.Object
hudson.model.DownloadService.Downloadable
io.jenkins.plugins.dotnet.data.Downloads
- All Implemented Interfaces:
ExtensionPoint
A data file containing the available .NET SDK installer packages.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A .NET package.static final class
A .NET release.static final class
A .NET SDK.static final class
A .NET version.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddPackages
(ListBoxModel model, String sdk) Adds the available packages for a specific SDK to a list box.addReleases
(ListBoxModel model, String version, boolean includePreview) Adds the available releases for a specific version to a list box.addSdks
(ListBoxModel model, String version, String release) Adds the available SDKs for a specific release to a list box.addVersions
(ListBoxModel model) Adds the available .NET versions to a list box.static Downloads
Gets the (single) instance ofDownloads
.getPackage
(String version, String release, String sdk, String url) Gets a package for a particular SDK, via its download link.getRelease
(String version, String name) Gets a release, via its name.Gets an SDK, via its name.Gets a release-specific SDK, via its name.getSdks()
Gets all known .NET SDKs.getVersion
(String name) Gets a version, via its name.Gets all known .NET versions.readJsonObjectArray
(net.sf.json.JSONObject o, String prop, Function<net.sf.json.JSONObject, T> convert, Function<T, String> createKey) Reads a JSON property containing an array of objects, converting them to a map of typed Java objects.readJsonStringArray
(net.sf.json.JSONObject o, String prop) Reads a JSON property containing an array of strings.Methods inherited from class hudson.model.DownloadService.Downloadable
all, get, get, getData, getDataFile, getDue, getId, getInterval, getUrl, getUrls, hasDuplicates, idFor, reduce, updateNow
-
Constructor Details
-
Downloads
@DataBoundConstructor public Downloads()Creates a newDownloads
downloadable.
-
-
Method Details
-
getPackage
@CheckForNull public Downloads.Package getPackage(@CheckForNull String version, @CheckForNull String release, @CheckForNull String sdk, @CheckForNull String url) Gets a package for a particular SDK, via its download link.- Parameters:
version
- The name of the version containing the release to which the package belongs.release
- The name of the release containing the SDK to which the package belongs.sdk
- The name of the SDK to which the package belongs.url
- The download link for the package.- Returns:
- The requested package, or
null
if it was not found.
-
getRelease
@CheckForNull public Downloads.Release getRelease(@CheckForNull String version, @CheckForNull String name) Gets a release, via its name.- Parameters:
version
- The name of the version containing the release.name
- The name of the release.- Returns:
- The requested release, or
null
if it was not found.
-
getSdk
Gets an SDK, via its name.- Parameters:
name
- The name of the SDK.- Returns:
- The requested SDK, or
null
if it was not found.
-
getSdk
@CheckForNull public Downloads.Sdk getSdk(@CheckForNull String version, @CheckForNull String release, @CheckForNull String name) Gets a release-specific SDK, via its name.- Parameters:
version
- The name of the version containing the release to which the SDK belongs.release
- The name of the release containing the SDK.name
- The name of the SDK.- Returns:
- The requested SDK, or
null
if it was not found.
-
getVersion
Gets a version, via its name.- Parameters:
name
- The name of the version.- Returns:
- The requested version, or
null
if it was not found.
-
addPackages
Adds the available packages for a specific SDK to a list box.- Parameters:
model
- The list box to add the packages to.sdk
- The name of the SDK containing the packages to add.- Returns:
- The updated list box.
-
addReleases
@NonNull public ListBoxModel addReleases(@NonNull ListBoxModel model, @CheckForNull String version, boolean includePreview) Adds the available releases for a specific version to a list box.- Parameters:
model
- The list box to add the releases to.version
- The name of the version containing the releases to add.includePreview
- Indicates whether preview releases should be included.- Returns:
- The updated list box.
-
addSdks
@NonNull public ListBoxModel addSdks(@NonNull ListBoxModel model, @CheckForNull String version, @CheckForNull String release) Adds the available SDKs for a specific release to a list box.- Parameters:
model
- The list box to add the SDKs to.version
- The name of the version containing the release.release
- The name of the release containing the SDKs to add.- Returns:
- The updated list box.
-
addVersions
Adds the available .NET versions to a list box.- Parameters:
model
- The list box to add the versions to.- Returns:
- The updated list box.
-
getInstance
Gets the (single) instance ofDownloads
.- Returns:
- An instance of
Downloads
, loaded with all available SDK installation packages for all .NET versions/releases.
-
getSdks
Gets all known .NET SDKs.- Returns:
- All known .NET SDKs.
-
getVersions
Gets all known .NET versions.- Returns:
- All known .NET versions.
-
readJsonObjectArray
@NonNull public static <T> Map<String,T> readJsonObjectArray(@NonNull net.sf.json.JSONObject o, @NonNull String prop, @NonNull Function<net.sf.json.JSONObject, T> convert, @NonNull Function<T, String> createKey) Reads a JSON property containing an array of objects, converting them to a map of typed Java objects.- Type Parameters:
T
- The specific Java object type to create from the array elements.- Parameters:
o
- The JSON object to take the property from.prop
- The name of the property to process.convert
- A function to convert an array element to the desired Java object.createKey
- A function to determine the key to use for a given (already-converted) object.- Returns:
- The resulting map.
-
readJsonStringArray
@NonNull public static List<String> readJsonStringArray(@NonNull net.sf.json.JSONObject o, @NonNull String prop) Reads a JSON property containing an array of strings.- Parameters:
o
- The JSON object to take the property from.prop
- The name of the property to process.- Returns:
- The resulting list of strings.
-