public static class DownloadService.Downloadable extends Object implements ExtensionPoint
This mechanism is one of the basis of the update center, which involves fetching up-to-date data file.
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
Downloadable() |
Downloadable(Class id)
Uses the class name as an ID.
|
Downloadable(String id) |
Downloadable(String id,
String url) |
Downloadable(String id,
String url,
long interval) |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<DownloadService.Downloadable> |
all()
Returns all the registered
DownloadService.Downloadable s. |
void |
doPostBack(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
This is where the browser sends us the data.
|
static DownloadService.Downloadable |
get(String id)
Returns the
DownloadService.Downloadable that has the given ID. |
net.sf.json.JSONObject |
getData()
Loads the current file into JSON and returns it, or null
if no data exists.
|
TextFile |
getDataFile()
This is where the retrieved file will be stored.
|
long |
getDue()
When shall we retrieve this file next time?
|
String |
getId() |
long |
getInterval()
How often do we retrieve the new image?
|
String |
getUrl()
URL to download.
|
FormValidation |
updateNow() |
public Downloadable(String id, String url, long interval)
url
- URL relative to UpdateCenter.getDefaultBaseUrl()
.
So if this string is "foo.json", the ultimate URL will be
something like "http://updates.jenkins-ci.org/updates/foo.json"
For security and privacy reasons, we don't allow the retrieval
from random locations.public Downloadable()
public Downloadable(Class id)
public Downloadable(String id)
public String getId()
public String getUrl()
public long getInterval()
public TextFile getDataFile()
public long getDue()
public net.sf.json.JSONObject getData() throws IOException
IOException
public void doPostBack(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOException
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation updateNow() throws IOException
IOException
public static ExtensionList<DownloadService.Downloadable> all()
DownloadService.Downloadable
s.public static DownloadService.Downloadable get(String id)
DownloadService.Downloadable
that has the given ID.Copyright © 2016. All rights reserved.