id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
125,700
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.getEstimatedDurationCandidates
@SuppressWarnings("unchecked") protected List<RunT> getEstimatedDurationCandidates() { List<RunT> candidates = new ArrayList<>(3); RunT lastSuccessful = getLastSuccessfulBuild(); int lastSuccessfulNumber = -1; if (lastSuccessful != null) { candidates.add(lastSuccessful); ...
java
@SuppressWarnings("unchecked") protected List<RunT> getEstimatedDurationCandidates() { List<RunT> candidates = new ArrayList<>(3); RunT lastSuccessful = getLastSuccessfulBuild(); int lastSuccessfulNumber = -1; if (lastSuccessful != null) { candidates.add(lastSuccessful); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "List", "<", "RunT", ">", "getEstimatedDurationCandidates", "(", ")", "{", "List", "<", "RunT", ">", "candidates", "=", "new", "ArrayList", "<>", "(", "3", ")", ";", "RunT", "lastSuccessful", "...
Returns candidate build for calculating the estimated duration of the current run. Returns the 3 last successful (stable or unstable) builds, if there are any. Failing to find 3 of those, it will return up to 3 last unsuccessful builds. In any case it will not go more than 6 builds into the past to avoid costly build...
[ "Returns", "candidate", "build", "for", "calculating", "the", "estimated", "duration", "of", "the", "current", "run", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1022-L1056
125,701
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.doRssChangelog
public void doRssChangelog(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { class FeedItem { ChangeLogSet.Entry e; int idx; public FeedItem(ChangeLogSet.Entry e, int idx) { this.e = e; this.idx = idx; ...
java
public void doRssChangelog(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { class FeedItem { ChangeLogSet.Entry e; int idx; public FeedItem(ChangeLogSet.Entry e, int idx) { this.e = e; this.idx = idx; ...
[ "public", "void", "doRssChangelog", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "class", "FeedItem", "{", "ChangeLogSet", ".", "Entry", "e", ";", "int", "idx", ";", "public", "FeedItem"...
RSS feed for changes in this project. @since 2.60
[ "RSS", "feed", "for", "changes", "in", "this", "project", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1091-L1159
125,702
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.getIconColor
@Exported(visibility = 2, name = "color") public BallColor getIconColor() { RunT lastBuild = getLastBuild(); while (lastBuild != null && lastBuild.hasntStartedYet()) lastBuild = lastBuild.getPreviousBuild(); if (lastBuild != null) return lastBuild.getIconColor(); ...
java
@Exported(visibility = 2, name = "color") public BallColor getIconColor() { RunT lastBuild = getLastBuild(); while (lastBuild != null && lastBuild.hasntStartedYet()) lastBuild = lastBuild.getPreviousBuild(); if (lastBuild != null) return lastBuild.getIconColor(); ...
[ "@", "Exported", "(", "visibility", "=", "2", ",", "name", "=", "\"color\"", ")", "public", "BallColor", "getIconColor", "(", ")", "{", "RunT", "lastBuild", "=", "getLastBuild", "(", ")", ";", "while", "(", "lastBuild", "!=", "null", "&&", "lastBuild", "...
Used as the color of the status ball for the project.
[ "Used", "as", "the", "color", "of", "the", "status", "ball", "for", "the", "project", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1178-L1188
125,703
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.getBuildHealth
public HealthReport getBuildHealth() { List<HealthReport> reports = getBuildHealthReports(); return reports.isEmpty() ? new HealthReport() : reports.get(0); }
java
public HealthReport getBuildHealth() { List<HealthReport> reports = getBuildHealthReports(); return reports.isEmpty() ? new HealthReport() : reports.get(0); }
[ "public", "HealthReport", "getBuildHealth", "(", ")", "{", "List", "<", "HealthReport", ">", "reports", "=", "getBuildHealthReports", "(", ")", ";", "return", "reports", ".", "isEmpty", "(", ")", "?", "new", "HealthReport", "(", ")", ":", "reports", ".", "...
Get the current health report for a job. @return the health report. Never returns null
[ "Get", "the", "current", "health", "report", "for", "a", "job", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1195-L1198
125,704
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.doDescription
public void doDescription(StaplerRequest req, StaplerResponse rsp) throws IOException { if (req.getMethod().equals("GET")) { //read rsp.setContentType("text/plain;charset=UTF-8"); rsp.getWriter().write(Util.fixNull(this.getDescription())); return; ...
java
public void doDescription(StaplerRequest req, StaplerResponse rsp) throws IOException { if (req.getMethod().equals("GET")) { //read rsp.setContentType("text/plain;charset=UTF-8"); rsp.getWriter().write(Util.fixNull(this.getDescription())); return; ...
[ "public", "void", "doDescription", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", "{", "if", "(", "req", ".", "getMethod", "(", ")", ".", "equals", "(", "\"GET\"", ")", ")", "{", "//read", "rsp", ".", "setContent...
Accepts and serves the job description
[ "Accepts", "and", "serves", "the", "job", "description" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1375-L1396
125,705
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.doBuildStatus
public void doBuildStatus(StaplerRequest req, StaplerResponse rsp) throws IOException { rsp.sendRedirect2(req.getContextPath() + "/images/48x48/" + getBuildStatusUrl()); }
java
public void doBuildStatus(StaplerRequest req, StaplerResponse rsp) throws IOException { rsp.sendRedirect2(req.getContextPath() + "/images/48x48/" + getBuildStatusUrl()); }
[ "public", "void", "doBuildStatus", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", "{", "rsp", ".", "sendRedirect2", "(", "req", ".", "getContextPath", "(", ")", "+", "\"/images/48x48/\"", "+", "getBuildStatusUrl", "(", ...
Returns the image that shows the current buildCommand status.
[ "Returns", "the", "image", "that", "shows", "the", "current", "buildCommand", "status", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1401-L1404
125,706
jenkinsci/jenkins
core/src/main/java/hudson/model/Job.java
Job.doDoRename
@Deprecated @RequirePOST public/* not synchronized. see renameTo() */void doDoRename( StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String newName = req.getParameter("newName"); doConfirmRename(newName).generateResponse(req, rsp, null); ...
java
@Deprecated @RequirePOST public/* not synchronized. see renameTo() */void doDoRename( StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String newName = req.getParameter("newName"); doConfirmRename(newName).generateResponse(req, rsp, null); ...
[ "@", "Deprecated", "@", "RequirePOST", "public", "/* not synchronized. see renameTo() */", "void", "doDoRename", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "String", "newName", "=", "req", "...
Renames this job. @deprecated Exists for backwards compatibility, use {@link #doConfirmRename} instead.
[ "Renames", "this", "job", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Job.java#L1563-L1570
125,707
jenkinsci/jenkins
core/src/main/java/hudson/widgets/BuildHistoryWidget.java
BuildHistoryWidget.getQueuedItems
public List<Item> getQueuedItems() { LinkedList<Item> list = new LinkedList<>(); for (Item item : Jenkins.getInstance().getQueue().getItems()) { if (item.task == owner) { list.addFirst(item); } } return list; }
java
public List<Item> getQueuedItems() { LinkedList<Item> list = new LinkedList<>(); for (Item item : Jenkins.getInstance().getQueue().getItems()) { if (item.task == owner) { list.addFirst(item); } } return list; }
[ "public", "List", "<", "Item", ">", "getQueuedItems", "(", ")", "{", "LinkedList", "<", "Item", ">", "list", "=", "new", "LinkedList", "<>", "(", ")", ";", "for", "(", "Item", "item", ":", "Jenkins", ".", "getInstance", "(", ")", ".", "getQueue", "("...
Returns the queue item if the owner is scheduled for execution in the queue, in REVERSE ORDER
[ "Returns", "the", "queue", "item", "if", "the", "owner", "is", "scheduled", "for", "execution", "in", "the", "queue", "in", "REVERSE", "ORDER" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/widgets/BuildHistoryWidget.java#L62-L70
125,708
jenkinsci/jenkins
core/src/main/java/hudson/model/ComputerSet.java
ComputerSet.get_slaveNames
public List<String> get_slaveNames() { return new AbstractList<String>() { final List<Node> nodes = Jenkins.getInstance().getNodes(); public String get(int index) { return nodes.get(index).getNodeName(); } public int size() { retu...
java
public List<String> get_slaveNames() { return new AbstractList<String>() { final List<Node> nodes = Jenkins.getInstance().getNodes(); public String get(int index) { return nodes.get(index).getNodeName(); } public int size() { retu...
[ "public", "List", "<", "String", ">", "get_slaveNames", "(", ")", "{", "return", "new", "AbstractList", "<", "String", ">", "(", ")", "{", "final", "List", "<", "Node", ">", "nodes", "=", "Jenkins", ".", "getInstance", "(", ")", ".", "getNodes", "(", ...
Gets all the agent names.
[ "Gets", "all", "the", "agent", "names", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerSet.java#L143-L155
125,709
jenkinsci/jenkins
core/src/main/java/hudson/model/ComputerSet.java
ComputerSet.doUpdateNow
@RequirePOST public void doUpdateNow( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); for (NodeMonitor nodeMonitor : NodeMonitor.getAll()) { Thread t = nodeMonitor.triggerUpdate(); ...
java
@RequirePOST public void doUpdateNow( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); for (NodeMonitor nodeMonitor : NodeMonitor.getAll()) { Thread t = nodeMonitor.triggerUpdate(); ...
[ "@", "RequirePOST", "public", "void", "doUpdateNow", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "Jenkins", ".", "getInstance", "(", ")", ".", "checkPermission", "(", "Jenkins", ".", "A...
Triggers the schedule update now. TODO: ajax on the client side to wait until the update completion might be nice.
[ "Triggers", "the", "schedule", "update", "now", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerSet.java#L220-L232
125,710
jenkinsci/jenkins
core/src/main/java/hudson/security/PermissionGroup.java
PermissionGroup.find
public synchronized Permission find(String name) { for (Permission p : permissions) { if(p.name.equals(name)) return p; } return null; }
java
public synchronized Permission find(String name) { for (Permission p : permissions) { if(p.name.equals(name)) return p; } return null; }
[ "public", "synchronized", "Permission", "find", "(", "String", "name", ")", "{", "for", "(", "Permission", "p", ":", "permissions", ")", "{", "if", "(", "p", ".", "name", ".", "equals", "(", "name", ")", ")", "return", "p", ";", "}", "return", "null"...
Finds a permission that has the given name.
[ "Finds", "a", "permission", "that", "has", "the", "given", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/PermissionGroup.java#L120-L126
125,711
jenkinsci/jenkins
core/src/main/java/hudson/Lookup.java
Lookup.setIfNull
public <T> T setIfNull(Class<T> type, T instance) { Object o = data.putIfAbsent(type, instance); if (o!=null) return type.cast(o); return instance; }
java
public <T> T setIfNull(Class<T> type, T instance) { Object o = data.putIfAbsent(type, instance); if (o!=null) return type.cast(o); return instance; }
[ "public", "<", "T", ">", "T", "setIfNull", "(", "Class", "<", "T", ">", "type", ",", "T", "instance", ")", "{", "Object", "o", "=", "data", ".", "putIfAbsent", "(", "type", ",", "instance", ")", ";", "if", "(", "o", "!=", "null", ")", "return", ...
Overwrites the value only if the current value is null. @return If the value was null, return the {@code instance} value. Otherwise return the current value, which is non-null.
[ "Overwrites", "the", "value", "only", "if", "the", "current", "value", "is", "null", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Lookup.java#L52-L56
125,712
jenkinsci/jenkins
core/src/main/java/hudson/ExtensionList.java
ExtensionList.add
@Override @Deprecated public boolean add(T t) { try { return addSync(t); } finally { if(extensions!=null) { fireOnChangeListeners(); } } }
java
@Override @Deprecated public boolean add(T t) { try { return addSync(t); } finally { if(extensions!=null) { fireOnChangeListeners(); } } }
[ "@", "Override", "@", "Deprecated", "public", "boolean", "add", "(", "T", "t", ")", "{", "try", "{", "return", "addSync", "(", "t", ")", ";", "}", "finally", "{", "if", "(", "extensions", "!=", "null", ")", "{", "fireOnChangeListeners", "(", ")", ";"...
Write access will put the instance into a legacy store. @deprecated since 2009-02-23. Prefer automatic registration.
[ "Write", "access", "will", "put", "the", "instance", "into", "a", "legacy", "store", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ExtensionList.java#L269-L279
125,713
jenkinsci/jenkins
core/src/main/java/hudson/ExtensionList.java
ExtensionList.getDynamic
public T getDynamic(String className) { for (T t : this) if (t.getClass().getName().equals(className)) return t; return null; }
java
public T getDynamic(String className) { for (T t : this) if (t.getClass().getName().equals(className)) return t; return null; }
[ "public", "T", "getDynamic", "(", "String", "className", ")", "{", "for", "(", "T", "t", ":", "this", ")", "if", "(", "t", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "className", ")", ")", "return", "t", ";", "return...
Used to bind extension to URLs by their class names. @since 1.349
[ "Used", "to", "bind", "extension", "to", "URLs", "by", "their", "class", "names", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ExtensionList.java#L302-L307
125,714
jenkinsci/jenkins
core/src/main/java/hudson/ExtensionList.java
ExtensionList.load
protected List<ExtensionComponent<T>> load() { LOGGER.fine(() -> String.format("Loading ExtensionList '%s'", extensionType.getName())); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, String.format("Loading ExtensionList '%s' from", extensionType.getName()), new Throwable("Only...
java
protected List<ExtensionComponent<T>> load() { LOGGER.fine(() -> String.format("Loading ExtensionList '%s'", extensionType.getName())); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, String.format("Loading ExtensionList '%s' from", extensionType.getName()), new Throwable("Only...
[ "protected", "List", "<", "ExtensionComponent", "<", "T", ">", ">", "load", "(", ")", "{", "LOGGER", ".", "fine", "(", "(", ")", "->", "String", ".", "format", "(", "\"Loading ExtensionList '%s'\"", ",", "extensionType", ".", "getName", "(", ")", ")", ")...
Loads all the extensions.
[ "Loads", "all", "the", "extensions", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ExtensionList.java#L375-L382
125,715
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.getJob
public UpdateCenterJob getJob(int id) { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job.id==id) return job; } } return null; }
java
public UpdateCenterJob getJob(int id) { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job.id==id) return job; } } return null; }
[ "public", "UpdateCenterJob", "getJob", "(", "int", "id", ")", "{", "synchronized", "(", "jobs", ")", "{", "for", "(", "UpdateCenterJob", "job", ":", "jobs", ")", "{", "if", "(", "job", ".", "id", "==", "id", ")", "return", "job", ";", "}", "}", "re...
Gets a job by its ID. Primarily to make {@link UpdateCenterJob} bound to URL.
[ "Gets", "a", "job", "by", "its", "ID", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L350-L358
125,716
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.doIncompleteInstallStatus
@Restricted(DoNotUse.class) // WebOnly public HttpResponse doIncompleteInstallStatus() { try { Map<String,String> jobs = InstallUtil.getPersistedInstallStatus(); if(jobs == null) { jobs = Collections.emptyMap(); } return HttpResponses.okJSON(jobs); } c...
java
@Restricted(DoNotUse.class) // WebOnly public HttpResponse doIncompleteInstallStatus() { try { Map<String,String> jobs = InstallUtil.getPersistedInstallStatus(); if(jobs == null) { jobs = Collections.emptyMap(); } return HttpResponses.okJSON(jobs); } c...
[ "@", "Restricted", "(", "DoNotUse", ".", "class", ")", "// WebOnly", "public", "HttpResponse", "doIncompleteInstallStatus", "(", ")", "{", "try", "{", "Map", "<", "String", ",", "String", ">", "jobs", "=", "InstallUtil", ".", "getPersistedInstallStatus", "(", ...
Called to determine if there was an incomplete installation, what the statuses of the plugins are
[ "Called", "to", "determine", "if", "there", "was", "an", "incomplete", "installation", "what", "the", "statuses", "of", "the", "plugins", "are" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L436-L447
125,717
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.persistInstallStatus
@Restricted(NoExternalUse.class) public synchronized void persistInstallStatus() { List<UpdateCenterJob> jobs = getJobs(); boolean activeInstalls = false; for (UpdateCenterJob job : jobs) { if (job instanceof InstallationJob) { InstallationJob installationJob = (...
java
@Restricted(NoExternalUse.class) public synchronized void persistInstallStatus() { List<UpdateCenterJob> jobs = getJobs(); boolean activeInstalls = false; for (UpdateCenterJob job : jobs) { if (job instanceof InstallationJob) { InstallationJob installationJob = (...
[ "@", "Restricted", "(", "NoExternalUse", ".", "class", ")", "public", "synchronized", "void", "persistInstallStatus", "(", ")", "{", "List", "<", "UpdateCenterJob", ">", "jobs", "=", "getJobs", "(", ")", ";", "boolean", "activeInstalls", "=", "false", ";", "...
Called to persist the currently installing plugin states. This allows us to support install resume if Jenkins is restarted while plugins are being installed.
[ "Called", "to", "persist", "the", "currently", "installing", "plugin", "states", ".", "This", "allows", "us", "to", "support", "install", "resume", "if", "Jenkins", "is", "restarted", "while", "plugins", "are", "being", "installed", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L454-L474
125,718
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.getHudsonJob
public HudsonUpgradeJob getHudsonJob() { List<UpdateCenterJob> jobList = getJobs(); Collections.reverse(jobList); for (UpdateCenterJob job : jobList) if (job instanceof HudsonUpgradeJob) return (HudsonUpgradeJob)job; return null; }
java
public HudsonUpgradeJob getHudsonJob() { List<UpdateCenterJob> jobList = getJobs(); Collections.reverse(jobList); for (UpdateCenterJob job : jobList) if (job instanceof HudsonUpgradeJob) return (HudsonUpgradeJob)job; return null; }
[ "public", "HudsonUpgradeJob", "getHudsonJob", "(", ")", "{", "List", "<", "UpdateCenterJob", ">", "jobList", "=", "getJobs", "(", ")", ";", "Collections", ".", "reverse", "(", "jobList", ")", ";", "for", "(", "UpdateCenterJob", "job", ":", "jobList", ")", ...
Returns latest Jenkins upgrade job. @return HudsonUpgradeJob or null if not found
[ "Returns", "latest", "Jenkins", "upgrade", "job", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L523-L530
125,719
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.doUpgrade
@RequirePOST public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException { HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Jenkins.getAuthentication()); if(!Lifecycle.get().canRewriteHudsonWar()) { sendError("Jenkins upgrade not supported in this running ...
java
@RequirePOST public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException { HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Jenkins.getAuthentication()); if(!Lifecycle.get().canRewriteHudsonWar()) { sendError("Jenkins upgrade not supported in this running ...
[ "@", "RequirePOST", "public", "void", "doUpgrade", "(", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "HudsonUpgradeJob", "job", "=", "new", "HudsonUpgradeJob", "(", "getCoreSource", "(", ")", ",", "Jenkins", ".", "getAuthen...
Schedules a Jenkins upgrade.
[ "Schedules", "a", "Jenkins", "upgrade", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L656-L667
125,720
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.doInvalidateData
@RequirePOST public HttpResponse doInvalidateData() { for (UpdateSite site : sites) { site.doInvalidateData(); } return HttpResponses.ok(); }
java
@RequirePOST public HttpResponse doInvalidateData() { for (UpdateSite site : sites) { site.doInvalidateData(); } return HttpResponses.ok(); }
[ "@", "RequirePOST", "public", "HttpResponse", "doInvalidateData", "(", ")", "{", "for", "(", "UpdateSite", "site", ":", "sites", ")", "{", "site", ".", "doInvalidateData", "(", ")", ";", "}", "return", "HttpResponses", ".", "ok", "(", ")", ";", "}" ]
Invalidates the update center JSON data for all the sites and force re-retrieval. @since 1.432
[ "Invalidates", "the", "update", "center", "JSON", "data", "for", "all", "the", "sites", "and", "force", "re", "-", "retrieval", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L674-L681
125,721
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.doSafeRestart
@RequirePOST public void doSafeRestart(StaplerRequest request, StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { if (!isRestartScheduled()) { addJob(new RestartJenkinsJob(getCoreSource())); LOGGER.info("Scheduling Jenkins reboo...
java
@RequirePOST public void doSafeRestart(StaplerRequest request, StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { if (!isRestartScheduled()) { addJob(new RestartJenkinsJob(getCoreSource())); LOGGER.info("Scheduling Jenkins reboo...
[ "@", "RequirePOST", "public", "void", "doSafeRestart", "(", "StaplerRequest", "request", ",", "StaplerResponse", "response", ")", "throws", "IOException", ",", "ServletException", "{", "synchronized", "(", "jobs", ")", "{", "if", "(", "!", "isRestartScheduled", "(...
Schedules a Jenkins restart.
[ "Schedules", "a", "Jenkins", "restart", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L687-L696
125,722
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.doCancelRestart
@RequirePOST public void doCancelRestart(StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job instanceof RestartJenkinsJob) { if (((RestartJenkinsJob) job).cancel()) { ...
java
@RequirePOST public void doCancelRestart(StaplerResponse response) throws IOException, ServletException { synchronized (jobs) { for (UpdateCenterJob job : jobs) { if (job instanceof RestartJenkinsJob) { if (((RestartJenkinsJob) job).cancel()) { ...
[ "@", "RequirePOST", "public", "void", "doCancelRestart", "(", "StaplerResponse", "response", ")", "throws", "IOException", ",", "ServletException", "{", "synchronized", "(", "jobs", ")", "{", "for", "(", "UpdateCenterJob", "job", ":", "jobs", ")", "{", "if", "...
Cancel all scheduled jenkins restarts
[ "Cancel", "all", "scheduled", "jenkins", "restarts" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L701-L713
125,723
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateCenter.java
UpdateCenter.getBackupVersion
public String getBackupVersion() { try { try (JarFile backupWar = new JarFile(new File(Lifecycle.get().getHudsonWar() + ".bak"))) { Attributes attrs = backupWar.getManifest().getMainAttributes(); String v = attrs.getValue("Jenkins-Version"); if (v == n...
java
public String getBackupVersion() { try { try (JarFile backupWar = new JarFile(new File(Lifecycle.get().getHudsonWar() + ".bak"))) { Attributes attrs = backupWar.getManifest().getMainAttributes(); String v = attrs.getValue("Jenkins-Version"); if (v == n...
[ "public", "String", "getBackupVersion", "(", ")", "{", "try", "{", "try", "(", "JarFile", "backupWar", "=", "new", "JarFile", "(", "new", "File", "(", "Lifecycle", ".", "get", "(", ")", ".", "getHudsonWar", "(", ")", "+", "\".bak\"", ")", ")", ")", "...
Returns String with version of backup .war file, if the file does not exists returns null
[ "Returns", "String", "with", "version", "of", "backup", ".", "war", "file", "if", "the", "file", "does", "not", "exists", "returns", "null" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateCenter.java#L788-L800
125,724
jenkinsci/jenkins
core/src/main/java/hudson/model/AbstractItem.java
AbstractItem.renameTo
protected void renameTo(final String newName) throws IOException { // always synchronize from bigger objects first final ItemGroup parent = getParent(); String oldName = this.name; String oldFullName = getFullName(); synchronized (parent) { synchronized (this) { ...
java
protected void renameTo(final String newName) throws IOException { // always synchronize from bigger objects first final ItemGroup parent = getParent(); String oldName = this.name; String oldFullName = getFullName(); synchronized (parent) { synchronized (this) { ...
[ "protected", "void", "renameTo", "(", "final", "String", "newName", ")", "throws", "IOException", "{", "// always synchronize from bigger objects first", "final", "ItemGroup", "parent", "=", "getParent", "(", ")", ";", "String", "oldName", "=", "this", ".", "name", ...
Renames this item. Not all the Items need to support this operation, but if you decide to do so, you can use this method.
[ "Renames", "this", "item", ".", "Not", "all", "the", "Items", "need", "to", "support", "this", "operation", "but", "if", "you", "decide", "to", "do", "so", "you", "can", "use", "this", "method", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L353-L445
125,725
jenkinsci/jenkins
core/src/main/java/hudson/model/AbstractItem.java
AbstractItem.updateByXml
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); XmlFile configXmlFile = getConfigFile(); final AtomicFileWriter out = new AtomicFileWriter(configXmlFile.getFile()); try { try { XMLUtils.safeTransform(source, new StreamRe...
java
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); XmlFile configXmlFile = getConfigFile(); final AtomicFileWriter out = new AtomicFileWriter(configXmlFile.getFile()); try { try { XMLUtils.safeTransform(source, new StreamRe...
[ "public", "void", "updateByXml", "(", "Source", "source", ")", "throws", "IOException", "{", "checkPermission", "(", "CONFIGURE", ")", ";", "XmlFile", "configXmlFile", "=", "getConfigFile", "(", ")", ";", "final", "AtomicFileWriter", "out", "=", "new", "AtomicFi...
Updates an Item by its XML definition. @param source source of the Item's new definition. The source should be either a <code>StreamSource</code> or a <code>SAXSource</code>, other sources may not be handled. @since 1.473
[ "Updates", "an", "Item", "by", "its", "XML", "definition", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L859-L894
125,726
jenkinsci/jenkins
core/src/main/java/hudson/model/AbstractItem.java
AbstractItem.doReload
@RequirePOST public void doReload() throws IOException { checkPermission(CONFIGURE); // try to reflect the changes by reloading getConfigFile().unmarshal(this); Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @Override publi...
java
@RequirePOST public void doReload() throws IOException { checkPermission(CONFIGURE); // try to reflect the changes by reloading getConfigFile().unmarshal(this); Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @Override publi...
[ "@", "RequirePOST", "public", "void", "doReload", "(", ")", "throws", "IOException", "{", "checkPermission", "(", "CONFIGURE", ")", ";", "// try to reflect the changes by reloading", "getConfigFile", "(", ")", ".", "unmarshal", "(", "this", ")", ";", "Items", ".",...
Reloads this job from the disk. Exposed through CLI as well. TODO: think about exposing this to UI @since 1.556
[ "Reloads", "this", "job", "from", "the", "disk", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractItem.java#L905-L921
125,727
jenkinsci/jenkins
core/src/main/java/jenkins/diagnostics/RootUrlNotSetMonitor.java
RootUrlNotSetMonitor.isUrlNull
@Restricted(NoExternalUse.class) public boolean isUrlNull(){ JenkinsLocationConfiguration loc = JenkinsLocationConfiguration.get(); return loc.getUrl() == null; }
java
@Restricted(NoExternalUse.class) public boolean isUrlNull(){ JenkinsLocationConfiguration loc = JenkinsLocationConfiguration.get(); return loc.getUrl() == null; }
[ "@", "Restricted", "(", "NoExternalUse", ".", "class", ")", "public", "boolean", "isUrlNull", "(", ")", "{", "JenkinsLocationConfiguration", "loc", "=", "JenkinsLocationConfiguration", ".", "get", "(", ")", ";", "return", "loc", ".", "getUrl", "(", ")", "==", ...
used by jelly to determined if it's a null url or invalid one
[ "used", "by", "jelly", "to", "determined", "if", "it", "s", "a", "null", "url", "or", "invalid", "one" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/diagnostics/RootUrlNotSetMonitor.java#L59-L63
125,728
jenkinsci/jenkins
core/src/main/java/hudson/model/TransientBuildActionFactory.java
TransientBuildActionFactory.createFor
public Collection<? extends Action> createFor(Run target) { if (target instanceof AbstractBuild) return createFor((AbstractBuild)target); else return Collections.emptyList(); }
java
public Collection<? extends Action> createFor(Run target) { if (target instanceof AbstractBuild) return createFor((AbstractBuild)target); else return Collections.emptyList(); }
[ "public", "Collection", "<", "?", "extends", "Action", ">", "createFor", "(", "Run", "target", ")", "{", "if", "(", "target", "instanceof", "AbstractBuild", ")", "return", "createFor", "(", "(", "AbstractBuild", ")", "target", ")", ";", "else", "return", "...
Creates actions for the given build. @param target for which the action objects are requested. Never null. @return Can be empty but must not be null.
[ "Creates", "actions", "for", "the", "given", "build", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/TransientBuildActionFactory.java#L28-L33
125,729
jenkinsci/jenkins
core/src/main/java/hudson/model/Actionable.java
Actionable.getActions
@Deprecated @Nonnull public List<Action> getActions() { //this double checked synchronization is only safe if the field 'actions' is volatile if (actions == null) { synchronized (this) { if (actions == null) { actions = new CopyOnWriteArrayList<>()...
java
@Deprecated @Nonnull public List<Action> getActions() { //this double checked synchronization is only safe if the field 'actions' is volatile if (actions == null) { synchronized (this) { if (actions == null) { actions = new CopyOnWriteArrayList<>()...
[ "@", "Deprecated", "@", "Nonnull", "public", "List", "<", "Action", ">", "getActions", "(", ")", "{", "//this double checked synchronization is only safe if the field 'actions' is volatile", "if", "(", "actions", "==", "null", ")", "{", "synchronized", "(", "this", ")...
Gets actions contributed to this object. <p> A new {@link Action} can be added by {@link #addAction}. <p>If you are <em>reading</em> the list, rather than <em>modifying</em> it, use {@link #getAllActions} instead. This method by default returns only <em>persistent</em> actions (though some subclasses override it to r...
[ "Gets", "actions", "contributed", "to", "this", "object", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Actionable.java#L74-L86
125,730
jenkinsci/jenkins
core/src/main/java/hudson/model/Actionable.java
Actionable.getActions
@Nonnull public <T extends Action> List<T> getActions(Class<T> type) { List<T> _actions = Util.filter(getActions(), type); for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), type)) { _actions.addAll(Util.filter(createFor(taf), type)); } r...
java
@Nonnull public <T extends Action> List<T> getActions(Class<T> type) { List<T> _actions = Util.filter(getActions(), type); for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), type)) { _actions.addAll(Util.filter(createFor(taf), type)); } r...
[ "@", "Nonnull", "public", "<", "T", "extends", "Action", ">", "List", "<", "T", ">", "getActions", "(", "Class", "<", "T", ">", "type", ")", "{", "List", "<", "T", ">", "_actions", "=", "Util", ".", "filter", "(", "getActions", "(", ")", ",", "ty...
Gets all actions of a specified type that contributed to this object. @param type The type of action to return. @return an unmodifiable, possible empty list @see #getAction(Class)
[ "Gets", "all", "actions", "of", "a", "specified", "type", "that", "contributed", "to", "this", "object", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Actionable.java#L135-L142
125,731
jenkinsci/jenkins
core/src/main/java/hudson/slaves/SlaveComputer.java
SlaveComputer.closeChannel
private void closeChannel() { // TODO: race condition between this and the setChannel method. Channel c; synchronized (channelLock) { c = channel; channel = null; absoluteRemoteFs = null; isUnix = null; } if (c != null) { ...
java
private void closeChannel() { // TODO: race condition between this and the setChannel method. Channel c; synchronized (channelLock) { c = channel; channel = null; absoluteRemoteFs = null; isUnix = null; } if (c != null) { ...
[ "private", "void", "closeChannel", "(", ")", "{", "// TODO: race condition between this and the setChannel method.", "Channel", "c", ";", "synchronized", "(", "channelLock", ")", "{", "c", "=", "channel", ";", "channel", "=", "null", ";", "absoluteRemoteFs", "=", "n...
If still connected, disconnect.
[ "If", "still", "connected", "disconnect", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/slaves/SlaveComputer.java#L821-L839
125,732
jenkinsci/jenkins
core/src/main/java/hudson/util/LineEndingConversion.java
LineEndingConversion.convertEOL
public static String convertEOL(String input, EOLType type) { if (null == input || 0 == input.length()) { return input; } // Convert line endings to Unix LF, // which also sets up the string for other conversions input = input.replace("\r\n","\n"); input = inp...
java
public static String convertEOL(String input, EOLType type) { if (null == input || 0 == input.length()) { return input; } // Convert line endings to Unix LF, // which also sets up the string for other conversions input = input.replace("\r\n","\n"); input = inp...
[ "public", "static", "String", "convertEOL", "(", "String", "input", ",", "EOLType", "type", ")", "{", "if", "(", "null", "==", "input", "||", "0", "==", "input", ".", "length", "(", ")", ")", "{", "return", "input", ";", "}", "// Convert line endings to ...
Convert line endings of a string to the given type. Default to Unix type. @param input The string containing line endings to be converted. @param type Type of line endings to convert the string into. @return String updated with the new line endings or null if given null.
[ "Convert", "line", "endings", "of", "a", "string", "to", "the", "given", "type", ".", "Default", "to", "Unix", "type", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/LineEndingConversion.java#L34-L64
125,733
jenkinsci/jenkins
core/src/main/java/hudson/model/Hudson.java
Hudson.getSlave
@Deprecated public Slave getSlave(String name) { Node n = getNode(name); if (n instanceof Slave) return (Slave)n; return null; }
java
@Deprecated public Slave getSlave(String name) { Node n = getNode(name); if (n instanceof Slave) return (Slave)n; return null; }
[ "@", "Deprecated", "public", "Slave", "getSlave", "(", "String", "name", ")", "{", "Node", "n", "=", "getNode", "(", "name", ")", ";", "if", "(", "n", "instanceof", "Slave", ")", "return", "(", "Slave", ")", "n", ";", "return", "null", ";", "}" ]
Gets the agent of the give name, hooked under this Hudson. @deprecated Use {@link #getNode(String)}. Since 1.252.
[ "Gets", "the", "agent", "of", "the", "give", "name", "hooked", "under", "this", "Hudson", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Hudson.java#L116-L122
125,734
jenkinsci/jenkins
cli/src/main/java/hudson/cli/Connection.java
Connection.writeObject
public void writeObject(Object o) throws IOException { ObjectOutputStream oos = AnonymousClassWarnings.checkingObjectOutputStream(out); oos.writeObject(o); // don't close oss, which will close the underlying stream // no need to flush either, given the way oos is implemented }
java
public void writeObject(Object o) throws IOException { ObjectOutputStream oos = AnonymousClassWarnings.checkingObjectOutputStream(out); oos.writeObject(o); // don't close oss, which will close the underlying stream // no need to flush either, given the way oos is implemented }
[ "public", "void", "writeObject", "(", "Object", "o", ")", "throws", "IOException", "{", "ObjectOutputStream", "oos", "=", "AnonymousClassWarnings", ".", "checkingObjectOutputStream", "(", "out", ")", ";", "oos", ".", "writeObject", "(", "o", ")", ";", "// don't ...
Sends a serializable object.
[ "Sends", "a", "serializable", "object", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/Connection.java#L106-L111
125,735
jenkinsci/jenkins
cli/src/main/java/hudson/cli/Connection.java
Connection.encryptConnection
public Connection encryptConnection(SecretKey sessionKey, String algorithm) throws IOException, GeneralSecurityException { Cipher cout = Cipher.getInstance(algorithm); cout.init(Cipher.ENCRYPT_MODE, sessionKey, new IvParameterSpec(sessionKey.getEncoded())); CipherOutputStream o = new CipherOutpu...
java
public Connection encryptConnection(SecretKey sessionKey, String algorithm) throws IOException, GeneralSecurityException { Cipher cout = Cipher.getInstance(algorithm); cout.init(Cipher.ENCRYPT_MODE, sessionKey, new IvParameterSpec(sessionKey.getEncoded())); CipherOutputStream o = new CipherOutpu...
[ "public", "Connection", "encryptConnection", "(", "SecretKey", "sessionKey", ",", "String", "algorithm", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "Cipher", "cout", "=", "Cipher", ".", "getInstance", "(", "algorithm", ")", ";", "cout", "....
Upgrades a connection with transport encryption by the specified symmetric cipher. @return A new {@link Connection} object that includes the transport encryption.
[ "Upgrades", "a", "connection", "with", "transport", "encryption", "by", "the", "specified", "symmetric", "cipher", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/Connection.java#L195-L205
125,736
jenkinsci/jenkins
cli/src/main/java/hudson/cli/Connection.java
Connection.fold
public static byte[] fold(byte[] bytes, int size) { byte[] r = new byte[size]; for (int i=Math.max(bytes.length,size)-1; i>=0; i-- ) { r[i%r.length] ^= bytes[i%bytes.length]; } return r; }
java
public static byte[] fold(byte[] bytes, int size) { byte[] r = new byte[size]; for (int i=Math.max(bytes.length,size)-1; i>=0; i-- ) { r[i%r.length] ^= bytes[i%bytes.length]; } return r; }
[ "public", "static", "byte", "[", "]", "fold", "(", "byte", "[", "]", "bytes", ",", "int", "size", ")", "{", "byte", "[", "]", "r", "=", "new", "byte", "[", "size", "]", ";", "for", "(", "int", "i", "=", "Math", ".", "max", "(", "bytes", ".", ...
Given a byte array that contains arbitrary number of bytes, digests or expands those bits into the specified number of bytes without loss of entropy. Cryptographic utility code.
[ "Given", "a", "byte", "array", "that", "contains", "arbitrary", "number", "of", "bytes", "digests", "or", "expands", "those", "bits", "into", "the", "specified", "number", "of", "bytes", "without", "loss", "of", "entropy", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/Connection.java#L213-L219
125,737
jenkinsci/jenkins
cli/src/main/java/hudson/cli/Connection.java
Connection.verifyIdentity
public PublicKey verifyIdentity(byte[] sharedSecret) throws IOException, GeneralSecurityException { try { String serverKeyAlgorithm = readUTF(); PublicKey spk = KeyFactory.getInstance(serverKeyAlgorithm).generatePublic(readKey()); // verify the identity of the server ...
java
public PublicKey verifyIdentity(byte[] sharedSecret) throws IOException, GeneralSecurityException { try { String serverKeyAlgorithm = readUTF(); PublicKey spk = KeyFactory.getInstance(serverKeyAlgorithm).generatePublic(readKey()); // verify the identity of the server ...
[ "public", "PublicKey", "verifyIdentity", "(", "byte", "[", "]", "sharedSecret", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "try", "{", "String", "serverKeyAlgorithm", "=", "readUTF", "(", ")", ";", "PublicKey", "spk", "=", "KeyFactory", ...
Verifies that we are talking to a peer that actually owns the private key corresponding to the public key we get.
[ "Verifies", "that", "we", "are", "talking", "to", "a", "peer", "that", "actually", "owns", "the", "private", "key", "corresponding", "to", "the", "public", "key", "we", "get", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/Connection.java#L250-L266
125,738
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.getTimestampString
public @Nonnull String getTimestampString() { long duration = System.currentTimeMillis()-timestamp.getTime(); return Util.getPastTimeString(duration); }
java
public @Nonnull String getTimestampString() { long duration = System.currentTimeMillis()-timestamp.getTime(); return Util.getPastTimeString(duration); }
[ "public", "@", "Nonnull", "String", "getTimestampString", "(", ")", "{", "long", "duration", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "timestamp", ".", "getTime", "(", ")", ";", "return", "Util", ".", "getPastTimeString", "(", "duration", ")",...
Gets the string that says how long since this build has scheduled. @return string like "3 minutes" "1 day" etc.
[ "Gets", "the", "string", "that", "says", "how", "long", "since", "this", "build", "has", "scheduled", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L944-L947
125,739
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.getRangeSet
public @Nonnull RangeSet getRangeSet(String jobFullName) { RangeSet r = usages.get(jobFullName); if(r==null) r = new RangeSet(); return r; }
java
public @Nonnull RangeSet getRangeSet(String jobFullName) { RangeSet r = usages.get(jobFullName); if(r==null) r = new RangeSet(); return r; }
[ "public", "@", "Nonnull", "RangeSet", "getRangeSet", "(", "String", "jobFullName", ")", "{", "RangeSet", "r", "=", "usages", ".", "get", "(", "jobFullName", ")", ";", "if", "(", "r", "==", "null", ")", "r", "=", "new", "RangeSet", "(", ")", ";", "ret...
Gets the build range set for the given job name. <p> These builds of this job has used this file. @return may be empty but not null.
[ "Gets", "the", "build", "range", "set", "for", "the", "given", "job", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L956-L960
125,740
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.getJobs
public @Nonnull List<String> getJobs() { List<String> r = new ArrayList<>(); r.addAll(usages.keySet()); Collections.sort(r); return r; }
java
public @Nonnull List<String> getJobs() { List<String> r = new ArrayList<>(); r.addAll(usages.keySet()); Collections.sort(r); return r; }
[ "public", "@", "Nonnull", "List", "<", "String", ">", "getJobs", "(", ")", "{", "List", "<", "String", ">", "r", "=", "new", "ArrayList", "<>", "(", ")", ";", "r", ".", "addAll", "(", "usages", ".", "keySet", "(", ")", ")", ";", "Collections", "....
Gets the sorted list of job names where this jar is used.
[ "Gets", "the", "sorted", "list", "of", "job", "names", "where", "this", "jar", "is", "used", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L969-L974
125,741
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint._getUsages
@Exported(name="usage") public @Nonnull List<RangeItem> _getUsages() { List<RangeItem> r = new ArrayList<>(); final Jenkins instance = Jenkins.getInstance(); for (Entry<String, RangeSet> e : usages.entrySet()) { final String itemName = e.getKey(); if (instance.hasPerm...
java
@Exported(name="usage") public @Nonnull List<RangeItem> _getUsages() { List<RangeItem> r = new ArrayList<>(); final Jenkins instance = Jenkins.getInstance(); for (Entry<String, RangeSet> e : usages.entrySet()) { final String itemName = e.getKey(); if (instance.hasPerm...
[ "@", "Exported", "(", "name", "=", "\"usage\"", ")", "public", "@", "Nonnull", "List", "<", "RangeItem", ">", "_getUsages", "(", ")", "{", "List", "<", "RangeItem", ">", "r", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "Jenkins", "instance",...
this is for remote API
[ "this", "is", "for", "remote", "API" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L994-L1005
125,742
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.isAlive
public synchronized boolean isAlive() { if(original!=null && original.isAlive()) return true; for (Entry<String,RangeSet> e : usages.entrySet()) { Job j = Jenkins.getInstance().getItemByFullName(e.getKey(),Job.class); if(j==null) continue; ...
java
public synchronized boolean isAlive() { if(original!=null && original.isAlive()) return true; for (Entry<String,RangeSet> e : usages.entrySet()) { Job j = Jenkins.getInstance().getItemByFullName(e.getKey(),Job.class); if(j==null) continue; ...
[ "public", "synchronized", "boolean", "isAlive", "(", ")", "{", "if", "(", "original", "!=", "null", "&&", "original", ".", "isAlive", "(", ")", ")", "return", "true", ";", "for", "(", "Entry", "<", "String", ",", "RangeSet", ">", "e", ":", "usages", ...
Returns true if any of the builds recorded in this fingerprint is still retained. <p> This is used to find out old fingerprint records that can be removed without losing too much information.
[ "Returns", "true", "if", "any", "of", "the", "builds", "recorded", "in", "this", "fingerprint", "is", "still", "retained", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1059-L1077
125,743
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.trim
public synchronized boolean trim() throws IOException { boolean modified = false; for (Entry<String,RangeSet> e : new Hashtable<>(usages).entrySet()) {// copy because we mutate Job j = Jenkins.getInstance().getItemByFullName(e.getKey(),Job.class); if(j==null) {// no such job any...
java
public synchronized boolean trim() throws IOException { boolean modified = false; for (Entry<String,RangeSet> e : new Hashtable<>(usages).entrySet()) {// copy because we mutate Job j = Jenkins.getInstance().getItemByFullName(e.getKey(),Job.class); if(j==null) {// no such job any...
[ "public", "synchronized", "boolean", "trim", "(", ")", "throws", "IOException", "{", "boolean", "modified", "=", "false", ";", "for", "(", "Entry", "<", "String", ",", "RangeSet", ">", "e", ":", "new", "Hashtable", "<>", "(", "usages", ")", ".", "entrySe...
Trim off references to non-existent builds and jobs, thereby making the fingerprint smaller. @return true if this record was modified. @throws IOException Save failure
[ "Trim", "off", "references", "to", "non", "-", "existent", "builds", "and", "jobs", "thereby", "making", "the", "fingerprint", "smaller", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1087-L1141
125,744
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.rename
public synchronized void rename(String oldName, String newName) throws IOException { boolean touched = false; if (original != null) { if (original.getName().equals(oldName)) { original.setName(newName); touched = true; } } ...
java
public synchronized void rename(String oldName, String newName) throws IOException { boolean touched = false; if (original != null) { if (original.getName().equals(oldName)) { original.setName(newName); touched = true; } } ...
[ "public", "synchronized", "void", "rename", "(", "String", "oldName", ",", "String", "newName", ")", "throws", "IOException", "{", "boolean", "touched", "=", "false", ";", "if", "(", "original", "!=", "null", ")", "{", "if", "(", "original", ".", "getName"...
Update references to a renamed job in the fingerprint
[ "Update", "references", "to", "a", "renamed", "job", "in", "the", "fingerprint" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1314-L1335
125,745
jenkinsci/jenkins
core/src/main/java/hudson/model/Fingerprint.java
Fingerprint.canDiscoverItem
private static boolean canDiscoverItem(@Nonnull final String fullName) { final Jenkins jenkins = Jenkins.getInstance(); // Fast check to avoid security context switches Item item = null; try { item = jenkins.getItemByFullName(fullName); } catch (AccessDeniedException...
java
private static boolean canDiscoverItem(@Nonnull final String fullName) { final Jenkins jenkins = Jenkins.getInstance(); // Fast check to avoid security context switches Item item = null; try { item = jenkins.getItemByFullName(fullName); } catch (AccessDeniedException...
[ "private", "static", "boolean", "canDiscoverItem", "(", "@", "Nonnull", "final", "String", "fullName", ")", "{", "final", "Jenkins", "jenkins", "=", "Jenkins", ".", "getInstance", "(", ")", ";", "// Fast check to avoid security context switches", "Item", "item", "="...
Checks if the current user can Discover the item. If yes, it may be displayed as a text in Fingerprint UIs. @param fullName Full name of the job @return {@code true} if the user can discover the item
[ "Checks", "if", "the", "current", "user", "can", "Discover", "the", "item", ".", "If", "yes", "it", "may", "be", "displayed", "as", "a", "text", "in", "Fingerprint", "UIs", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Fingerprint.java#L1432-L1474
125,746
jenkinsci/jenkins
core/src/main/java/hudson/model/View.java
View.rename
public void rename(String newName) throws Failure, FormException { if(name.equals(newName)) return; // noop Jenkins.checkGoodName(newName); if(owner.getView(newName)!=null) throw new FormException(Messages.Hudson_ViewAlreadyExists(newName),"name"); String oldName = name; ...
java
public void rename(String newName) throws Failure, FormException { if(name.equals(newName)) return; // noop Jenkins.checkGoodName(newName); if(owner.getView(newName)!=null) throw new FormException(Messages.Hudson_ViewAlreadyExists(newName),"name"); String oldName = name; ...
[ "public", "void", "rename", "(", "String", "newName", ")", "throws", "Failure", ",", "FormException", "{", "if", "(", "name", ".", "equals", "(", "newName", ")", ")", "return", ";", "// noop", "Jenkins", ".", "checkGoodName", "(", "newName", ")", ";", "i...
Renames this view.
[ "Renames", "this", "view", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L253-L261
125,747
jenkinsci/jenkins
core/src/main/java/hudson/model/View.java
View.getProperties
public DescribableList<ViewProperty,ViewPropertyDescriptor> getProperties() { // readResolve was the best place to do this, but for compatibility reasons, // this class can no longer have readResolve() (the mechanism itself isn't suitable for class hierarchy) // see JENKINS-9431 // ...
java
public DescribableList<ViewProperty,ViewPropertyDescriptor> getProperties() { // readResolve was the best place to do this, but for compatibility reasons, // this class can no longer have readResolve() (the mechanism itself isn't suitable for class hierarchy) // see JENKINS-9431 // ...
[ "public", "DescribableList", "<", "ViewProperty", ",", "ViewPropertyDescriptor", ">", "getProperties", "(", ")", "{", "// readResolve was the best place to do this, but for compatibility reasons,", "// this class can no longer have readResolve() (the mechanism itself isn't suitable for class...
Gets the view properties configured for this view. @since 1.406
[ "Gets", "the", "view", "properties", "configured", "for", "this", "view", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L300-L314
125,748
jenkinsci/jenkins
core/src/main/java/hudson/model/View.java
View.doDoDelete
@RequirePOST public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
java
@RequirePOST public synchronized void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(DELETE); owner.deleteView(this); rsp.sendRedirect2(req.getContextPath()+"/" + owner.getUrl()); }
[ "@", "RequirePOST", "public", "synchronized", "void", "doDoDelete", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "checkPermission", "(", "DELETE", ")", ";", "owner", ".", "deleteView", "("...
Deletes this view.
[ "Deletes", "this", "view", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L1012-L1019
125,749
jenkinsci/jenkins
core/src/main/java/hudson/model/View.java
View.updateByXml
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); StringWriter out = new StringWriter(); try { // this allows us to use UTF-8 for storing data, // plus it checks any well-formedness issue in the submitted // data ...
java
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); StringWriter out = new StringWriter(); try { // this allows us to use UTF-8 for storing data, // plus it checks any well-formedness issue in the submitted // data ...
[ "public", "void", "updateByXml", "(", "Source", "source", ")", "throws", "IOException", "{", "checkPermission", "(", "CONFIGURE", ")", ";", "StringWriter", "out", "=", "new", "StringWriter", "(", ")", ";", "try", "{", "// this allows us to use UTF-8 for storing data...
Updates the View with the new XML definition. @param source source of the Item's new definition. The source should be either a <code>StreamSource</code> or <code>SAXSource</code>, other sources may not be handled.
[ "Updates", "the", "View", "with", "the", "new", "XML", "definition", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L1196-L1229
125,750
jenkinsci/jenkins
core/src/main/java/hudson/model/View.java
View.createViewFromXML
public static View createViewFromXML(String name, InputStream xml) throws IOException { try (InputStream in = new BufferedInputStream(xml)) { View v = (View) Jenkins.XSTREAM.fromXML(in); if (name != null) v.name = name; Jenkins.checkGoodName(v.name); return v; ...
java
public static View createViewFromXML(String name, InputStream xml) throws IOException { try (InputStream in = new BufferedInputStream(xml)) { View v = (View) Jenkins.XSTREAM.fromXML(in); if (name != null) v.name = name; Jenkins.checkGoodName(v.name); return v; ...
[ "public", "static", "View", "createViewFromXML", "(", "String", "name", ",", "InputStream", "xml", ")", "throws", "IOException", "{", "try", "(", "InputStream", "in", "=", "new", "BufferedInputStream", "(", "xml", ")", ")", "{", "View", "v", "=", "(", "Vie...
Instantiate View subtype from XML stream. @param name Alternative name to use or {@code null} to keep the one in xml.
[ "Instantiate", "View", "subtype", "from", "XML", "stream", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L1371-L1381
125,751
jenkinsci/jenkins
core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java
DownloadFromUrlInstaller.isUpToDate
protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
java
protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
[ "protected", "boolean", "isUpToDate", "(", "FilePath", "expectedLocation", ",", "Installable", "i", ")", "throws", "IOException", ",", "InterruptedException", "{", "FilePath", "marker", "=", "expectedLocation", ".", "child", "(", "\".installedFrom\"", ")", ";", "ret...
Checks if the specified expected location already contains the installed version of the tool. This check needs to run fairly efficiently. The current implementation uses the source URL of {@link Installable}, based on the assumption that released bits do not change its content.
[ "Checks", "if", "the", "specified", "expected", "location", "already", "contains", "the", "installed", "version", "of", "the", "tool", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java#L44-L47
125,752
jenkinsci/jenkins
core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java
DownloadFromUrlInstaller.findPullUpDirectory
protected FilePath findPullUpDirectory(FilePath root) throws IOException, InterruptedException { // if the directory just contains one directory and that alone, assume that's the pull up subject // otherwise leave it as is. List<FilePath> children = root.list(); if(children.size()!=1) ...
java
protected FilePath findPullUpDirectory(FilePath root) throws IOException, InterruptedException { // if the directory just contains one directory and that alone, assume that's the pull up subject // otherwise leave it as is. List<FilePath> children = root.list(); if(children.size()!=1) ...
[ "protected", "FilePath", "findPullUpDirectory", "(", "FilePath", "root", ")", "throws", "IOException", ",", "InterruptedException", "{", "// if the directory just contains one directory and that alone, assume that's the pull up subject", "// otherwise leave it as is.", "List", "<", "...
Often an archive contains an extra top-level directory that's unnecessary when extracted on the disk into the expected location. If your installation sources provide that kind of archives, override this method to find the real root location. <p> The caller will "pull up" the discovered real root by throw away the inte...
[ "Often", "an", "archive", "contains", "an", "extra", "top", "-", "level", "directory", "that", "s", "unnecessary", "when", "extracted", "on", "the", "disk", "into", "the", "expected", "location", ".", "If", "your", "installation", "sources", "provide", "that",...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tools/DownloadFromUrlInstaller.java#L114-L122
125,753
jenkinsci/jenkins
core/src/main/java/hudson/util/TextFile.java
TextFile.read
public String read() throws IOException { StringWriter out = new StringWriter(); PrintWriter w = new PrintWriter(out); try (BufferedReader in = Files.newBufferedReader(Util.fileToPath(file), StandardCharsets.UTF_8)) { String line; while ((line = in.readLine()) != null) ...
java
public String read() throws IOException { StringWriter out = new StringWriter(); PrintWriter w = new PrintWriter(out); try (BufferedReader in = Files.newBufferedReader(Util.fileToPath(file), StandardCharsets.UTF_8)) { String line; while ((line = in.readLine()) != null) ...
[ "public", "String", "read", "(", ")", "throws", "IOException", "{", "StringWriter", "out", "=", "new", "StringWriter", "(", ")", ";", "PrintWriter", "w", "=", "new", "PrintWriter", "(", "out", ")", ";", "try", "(", "BufferedReader", "in", "=", "Files", "...
Reads the entire contents and returns it.
[ "Reads", "the", "entire", "contents", "and", "returns", "it", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/TextFile.java#L70-L81
125,754
jenkinsci/jenkins
core/src/main/java/hudson/util/TextFile.java
TextFile.write
public void write(String text) throws IOException { file.getParentFile().mkdirs(); AtomicFileWriter w = new AtomicFileWriter(file); try { w.write(text); w.commit(); } finally { w.abort(); } }
java
public void write(String text) throws IOException { file.getParentFile().mkdirs(); AtomicFileWriter w = new AtomicFileWriter(file); try { w.write(text); w.commit(); } finally { w.abort(); } }
[ "public", "void", "write", "(", "String", "text", ")", "throws", "IOException", "{", "file", ".", "getParentFile", "(", ")", ".", "mkdirs", "(", ")", ";", "AtomicFileWriter", "w", "=", "new", "AtomicFileWriter", "(", "file", ")", ";", "try", "{", "w", ...
Overwrites the file by the given string.
[ "Overwrites", "the", "file", "by", "the", "given", "string", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/TextFile.java#L114-L123
125,755
jenkinsci/jenkins
core/src/main/java/hudson/util/TextFile.java
TextFile.head
public @Nonnull String head(int numChars) throws IOException { char[] buf = new char[numChars]; int read = 0; try (Reader r = new FileReader(file)) { while (read<numChars) { int d = r.read(buf,read,buf.length-read); if (d<0) break; ...
java
public @Nonnull String head(int numChars) throws IOException { char[] buf = new char[numChars]; int read = 0; try (Reader r = new FileReader(file)) { while (read<numChars) { int d = r.read(buf,read,buf.length-read); if (d<0) break; ...
[ "public", "@", "Nonnull", "String", "head", "(", "int", "numChars", ")", "throws", "IOException", "{", "char", "[", "]", "buf", "=", "new", "char", "[", "numChars", "]", ";", "int", "read", "=", "0", ";", "try", "(", "Reader", "r", "=", "new", "Fil...
Reads the first N characters or until we hit EOF.
[ "Reads", "the", "first", "N", "characters", "or", "until", "we", "hit", "EOF", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/TextFile.java#L128-L141
125,756
jenkinsci/jenkins
core/src/main/java/hudson/security/DeferredCreationLdapAuthoritiesPopulator.java
DeferredCreationLdapAuthoritiesPopulator.create
private DefaultLdapAuthoritiesPopulator create() { DefaultLdapAuthoritiesPopulator populator = new DefaultLdapAuthoritiesPopulator( initialDirContextFactory, groupSearchBase); populator.setConvertToUpperCase(convertToUpperCase); if (defaultRole != null) { populator.se...
java
private DefaultLdapAuthoritiesPopulator create() { DefaultLdapAuthoritiesPopulator populator = new DefaultLdapAuthoritiesPopulator( initialDirContextFactory, groupSearchBase); populator.setConvertToUpperCase(convertToUpperCase); if (defaultRole != null) { populator.se...
[ "private", "DefaultLdapAuthoritiesPopulator", "create", "(", ")", "{", "DefaultLdapAuthoritiesPopulator", "populator", "=", "new", "DefaultLdapAuthoritiesPopulator", "(", "initialDirContextFactory", ",", "groupSearchBase", ")", ";", "populator", ".", "setConvertToUpperCase", ...
Create a new DefaultLdapAuthoritiesPopulator object. @return a DefaultLdapAuthoritiesPopulator.
[ "Create", "a", "new", "DefaultLdapAuthoritiesPopulator", "object", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/DeferredCreationLdapAuthoritiesPopulator.java#L144-L156
125,757
jenkinsci/jenkins
core/src/main/java/hudson/model/FileParameterValue.java
FileParameterValue.buildEnvironment
@Override public void buildEnvironment(Run<?,?> build, EnvVars env) { env.put(name,originalFileName); }
java
@Override public void buildEnvironment(Run<?,?> build, EnvVars env) { env.put(name,originalFileName); }
[ "@", "Override", "public", "void", "buildEnvironment", "(", "Run", "<", "?", ",", "?", ">", "build", ",", "EnvVars", "env", ")", "{", "env", ".", "put", "(", "name", ",", "originalFileName", ")", ";", "}" ]
Exposes the originalFileName as an environment variable.
[ "Exposes", "the", "originalFileName", "as", "an", "environment", "variable", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/FileParameterValue.java#L125-L128
125,758
jenkinsci/jenkins
core/src/main/java/hudson/os/solaris/ZFSInstaller.java
ZFSInstaller.doAct
@RequirePOST public HttpResponse doAct(StaplerRequest req) throws ServletException, IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); if(req.hasParameter("n")) { // we'll shut up disable(true); return HttpResponses.redirectViaContextPath("/...
java
@RequirePOST public HttpResponse doAct(StaplerRequest req) throws ServletException, IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); if(req.hasParameter("n")) { // we'll shut up disable(true); return HttpResponses.redirectViaContextPath("/...
[ "@", "RequirePOST", "public", "HttpResponse", "doAct", "(", "StaplerRequest", "req", ")", "throws", "ServletException", ",", "IOException", "{", "Jenkins", ".", "getInstance", "(", ")", ".", "checkPermission", "(", "Jenkins", ".", "ADMINISTER", ")", ";", "if", ...
Called from the management screen.
[ "Called", "from", "the", "management", "screen", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/os/solaris/ZFSInstaller.java#L133-L144
125,759
jenkinsci/jenkins
core/src/main/java/hudson/os/solaris/ZFSInstaller.java
ZFSInstaller.createZfsFileSystem
private String createZfsFileSystem(final TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException, ZFSException { // capture the UID that Hudson runs under // so that we can allow this user to do everything on this new partition final int uid = LI...
java
private String createZfsFileSystem(final TaskListener listener, String rootUsername, String rootPassword) throws IOException, InterruptedException, ZFSException { // capture the UID that Hudson runs under // so that we can allow this user to do everything on this new partition final int uid = LI...
[ "private", "String", "createZfsFileSystem", "(", "final", "TaskListener", "listener", ",", "String", "rootUsername", ",", "String", "rootPassword", ")", "throws", "IOException", ",", "InterruptedException", ",", "ZFSException", "{", "// capture the UID that Hudson runs unde...
Creates a ZFS file system to migrate the data to. <p> This has to be done while we still have an interactive access with the user, since it involves the password. <p> An exception will be thrown if the operation fails. A normal completion means a success. @return The ZFS dataset name to migrate the data to.
[ "Creates", "a", "ZFS", "file", "system", "to", "migrate", "the", "data", "to", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/os/solaris/ZFSInstaller.java#L158-L173
125,760
jenkinsci/jenkins
core/src/main/java/hudson/model/AbstractModelObject.java
AbstractModelObject.requirePOST
@Deprecated protected final void requirePOST() throws ServletException { StaplerRequest req = Stapler.getCurrentRequest(); if (req==null) return; // invoked outside the context of servlet String method = req.getMethod(); if(!method.equalsIgnoreCase("POST")) throw new Ser...
java
@Deprecated protected final void requirePOST() throws ServletException { StaplerRequest req = Stapler.getCurrentRequest(); if (req==null) return; // invoked outside the context of servlet String method = req.getMethod(); if(!method.equalsIgnoreCase("POST")) throw new Ser...
[ "@", "Deprecated", "protected", "final", "void", "requirePOST", "(", ")", "throws", "ServletException", "{", "StaplerRequest", "req", "=", "Stapler", ".", "getCurrentRequest", "(", ")", ";", "if", "(", "req", "==", "null", ")", "return", ";", "// invoked outsi...
Convenience method to verify that the current request is a POST request. @deprecated Use {@link RequirePOST} on your method.
[ "Convenience", "method", "to", "verify", "that", "the", "current", "request", "is", "a", "POST", "request", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractModelObject.java#L84-L91
125,761
jenkinsci/jenkins
core/src/main/java/hudson/security/AccessDeniedException2.java
AccessDeniedException2.reportAsHeaders
public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); if (REPORT_GROUP_HEADERS) { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); ...
java
public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); if (REPORT_GROUP_HEADERS) { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); ...
[ "public", "void", "reportAsHeaders", "(", "HttpServletResponse", "rsp", ")", "{", "rsp", ".", "addHeader", "(", "\"X-You-Are-Authenticated-As\"", ",", "authentication", ".", "getName", "(", ")", ")", ";", "if", "(", "REPORT_GROUP_HEADERS", ")", "{", "for", "(", ...
Reports the details of the access failure in HTTP headers to assist diagnosis.
[ "Reports", "the", "details", "of", "the", "access", "failure", "in", "HTTP", "headers", "to", "assist", "diagnosis", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/AccessDeniedException2.java#L44-L57
125,762
jenkinsci/jenkins
core/src/main/java/jenkins/install/InstallUtil.java
InstallUtil.proceedToNextStateFrom
public static void proceedToNextStateFrom(InstallState prior) { InstallState next = getNextInstallState(prior); if (next != null) { Jenkins.getInstance().setInstallState(next); } }
java
public static void proceedToNextStateFrom(InstallState prior) { InstallState next = getNextInstallState(prior); if (next != null) { Jenkins.getInstance().setInstallState(next); } }
[ "public", "static", "void", "proceedToNextStateFrom", "(", "InstallState", "prior", ")", "{", "InstallState", "next", "=", "getNextInstallState", "(", "prior", ")", ";", "if", "(", "next", "!=", "null", ")", "{", "Jenkins", ".", "getInstance", "(", ")", ".",...
Proceed to the state following the provided one
[ "Proceed", "to", "the", "state", "following", "the", "provided", "one" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/install/InstallUtil.java#L93-L98
125,763
jenkinsci/jenkins
core/src/main/java/jenkins/install/InstallUtil.java
InstallUtil.getLastExecVersion
public static @Nonnull String getLastExecVersion() { File lastExecVersionFile = getLastExecVersionFile(); if (lastExecVersionFile.exists()) { try { String version = FileUtils.readFileToString(lastExecVersionFile); // JENKINS-37438 blank will force the setup ...
java
public static @Nonnull String getLastExecVersion() { File lastExecVersionFile = getLastExecVersionFile(); if (lastExecVersionFile.exists()) { try { String version = FileUtils.readFileToString(lastExecVersionFile); // JENKINS-37438 blank will force the setup ...
[ "public", "static", "@", "Nonnull", "String", "getLastExecVersion", "(", ")", "{", "File", "lastExecVersionFile", "=", "getLastExecVersionFile", "(", ")", ";", "if", "(", "lastExecVersionFile", ".", "exists", "(", ")", ")", "{", "try", "{", "String", "version"...
Get the last saved Jenkins instance version. @return The last saved Jenkins instance version. @see #saveLastExecVersion()
[ "Get", "the", "last", "saved", "Jenkins", "instance", "version", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/install/InstallUtil.java#L223-L261
125,764
jenkinsci/jenkins
core/src/main/java/jenkins/install/InstallUtil.java
InstallUtil.getPersistedInstallStatus
@SuppressWarnings("unchecked") public static synchronized @CheckForNull Map<String,String> getPersistedInstallStatus() { File installingPluginsFile = getInstallingPluginsFile(); if(installingPluginsFile == null || !installingPluginsFile.exists()) { return null; } return (Map<String,St...
java
@SuppressWarnings("unchecked") public static synchronized @CheckForNull Map<String,String> getPersistedInstallStatus() { File installingPluginsFile = getInstallingPluginsFile(); if(installingPluginsFile == null || !installingPluginsFile.exists()) { return null; } return (Map<String,St...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "synchronized", "@", "CheckForNull", "Map", "<", "String", ",", "String", ">", "getPersistedInstallStatus", "(", ")", "{", "File", "installingPluginsFile", "=", "getInstallingPluginsFile", "(", ...
Returns a list of any plugins that are persisted in the installing list
[ "Returns", "a", "list", "of", "any", "plugins", "that", "are", "persisted", "in", "the", "installing", "list" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/install/InstallUtil.java#L299-L306
125,765
jenkinsci/jenkins
core/src/main/java/jenkins/install/InstallUtil.java
InstallUtil.persistInstallStatus
public static synchronized void persistInstallStatus(List<UpdateCenterJob> installingPlugins) { File installingPluginsFile = getInstallingPluginsFile(); if(installingPlugins == null || installingPlugins.isEmpty()) { installingPluginsFile.delete(); return; } LOGGER.fine("Writing install state to: " + inst...
java
public static synchronized void persistInstallStatus(List<UpdateCenterJob> installingPlugins) { File installingPluginsFile = getInstallingPluginsFile(); if(installingPlugins == null || installingPlugins.isEmpty()) { installingPluginsFile.delete(); return; } LOGGER.fine("Writing install state to: " + inst...
[ "public", "static", "synchronized", "void", "persistInstallStatus", "(", "List", "<", "UpdateCenterJob", ">", "installingPlugins", ")", "{", "File", "installingPluginsFile", "=", "getInstallingPluginsFile", "(", ")", ";", "if", "(", "installingPlugins", "==", "null", ...
Persists a list of installing plugins; this is used in the case Jenkins fails mid-installation and needs to be restarted @param installingPlugins
[ "Persists", "a", "list", "of", "installing", "plugins", ";", "this", "is", "used", "in", "the", "case", "Jenkins", "fails", "mid", "-", "installation", "and", "needs", "to", "be", "restarted" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/install/InstallUtil.java#L312-L337
125,766
jenkinsci/jenkins
core/src/main/java/hudson/util/Retrier.java
Retrier.start
public @CheckForNull V start() throws Exception { V result = null; int currentAttempt = 0; boolean success = false; while (currentAttempt < attempts && !success) { currentAttempt++; try { if (LOGGER.isLoggable(Level.INFO)) { LO...
java
public @CheckForNull V start() throws Exception { V result = null; int currentAttempt = 0; boolean success = false; while (currentAttempt < attempts && !success) { currentAttempt++; try { if (LOGGER.isLoggable(Level.INFO)) { LO...
[ "public", "@", "CheckForNull", "V", "start", "(", ")", "throws", "Exception", "{", "V", "result", "=", "null", ";", "int", "currentAttempt", "=", "0", ";", "boolean", "success", "=", "false", ";", "while", "(", "currentAttempt", "<", "attempts", "&&", "!...
Start to do retries to perform the set action. @return the result of the action, it could be null if there was an exception or if the action itself returns null @throws Exception If a unallowed exception is raised during the action
[ "Start", "to", "do", "retries", "to", "perform", "the", "set", "action", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/Retrier.java#L51-L102
125,767
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.setClassPath
public void setClassPath(Path classpath) { pathComponents.removeAllElements(); if (classpath != null) { Path actualClasspath = classpath.concatSystemClasspath("ignore"); String[] pathElements = actualClasspath.list(); for (int i = 0; i < pathElements.length; ++i) { ...
java
public void setClassPath(Path classpath) { pathComponents.removeAllElements(); if (classpath != null) { Path actualClasspath = classpath.concatSystemClasspath("ignore"); String[] pathElements = actualClasspath.list(); for (int i = 0; i < pathElements.length; ++i) { ...
[ "public", "void", "setClassPath", "(", "Path", "classpath", ")", "{", "pathComponents", ".", "removeAllElements", "(", ")", ";", "if", "(", "classpath", "!=", "null", ")", "{", "Path", "actualClasspath", "=", "classpath", ".", "concatSystemClasspath", "(", "\"...
Set the classpath to search for classes to load. This should not be changed once the classloader starts to server classes @param classpath the search classpath consisting of directories and jar/zip files.
[ "Set", "the", "classpath", "to", "search", "for", "classes", "to", "load", ".", "This", "should", "not", "be", "changed", "once", "the", "classloader", "starts", "to", "server", "classes" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L362-L376
125,768
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.log
protected void log(String message, int priority) { if (project != null) { project.log(message, priority); } }
java
protected void log(String message, int priority) { if (project != null) { project.log(message, priority); } }
[ "protected", "void", "log", "(", "String", "message", ",", "int", "priority", ")", "{", "if", "(", "project", "!=", "null", ")", "{", "project", ".", "log", "(", "message", ",", "priority", ")", ";", "}", "}" ]
Logs a message through the project object if one has been provided. @param message The message to log. Should not be <code>null</code>. @param priority The logging priority of the message.
[ "Logs", "a", "message", "through", "the", "project", "object", "if", "one", "has", "been", "provided", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L408-L412
125,769
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.setThreadContextLoader
public void setThreadContextLoader() { if (isContextLoaderSaved) { throw new BuildException("Context loader has not been reset"); } if (LoaderUtils.isContextLoaderAvailable()) { savedContextLoader = LoaderUtils.getContextClassLoader(); ClassLoader loader = thi...
java
public void setThreadContextLoader() { if (isContextLoaderSaved) { throw new BuildException("Context loader has not been reset"); } if (LoaderUtils.isContextLoaderAvailable()) { savedContextLoader = LoaderUtils.getContextClassLoader(); ClassLoader loader = thi...
[ "public", "void", "setThreadContextLoader", "(", ")", "{", "if", "(", "isContextLoaderSaved", ")", "{", "throw", "new", "BuildException", "(", "\"Context loader has not been reset\"", ")", ";", "}", "if", "(", "LoaderUtils", ".", "isContextLoaderAvailable", "(", ")"...
Sets the current thread's context loader to this classloader, storing the current loader value for later resetting.
[ "Sets", "the", "current", "thread", "s", "context", "loader", "to", "this", "classloader", "storing", "the", "current", "loader", "value", "for", "later", "resetting", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L418-L431
125,770
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.resetThreadContextLoader
public void resetThreadContextLoader() { if (LoaderUtils.isContextLoaderAvailable() && isContextLoaderSaved) { LoaderUtils.setContextClassLoader(savedContextLoader); savedContextLoader = null; isContextLoaderSaved = false; } }
java
public void resetThreadContextLoader() { if (LoaderUtils.isContextLoaderAvailable() && isContextLoaderSaved) { LoaderUtils.setContextClassLoader(savedContextLoader); savedContextLoader = null; isContextLoaderSaved = false; } }
[ "public", "void", "resetThreadContextLoader", "(", ")", "{", "if", "(", "LoaderUtils", ".", "isContextLoaderAvailable", "(", ")", "&&", "isContextLoaderSaved", ")", "{", "LoaderUtils", ".", "setContextClassLoader", "(", "savedContextLoader", ")", ";", "savedContextLoa...
Resets the current thread's context loader to its original value.
[ "Resets", "the", "current", "thread", "s", "context", "loader", "to", "its", "original", "value", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L436-L442
125,771
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.addPathElement
public void addPathElement(String pathElement) throws BuildException { File pathComponent = project != null ? project.resolveFile(pathElement) : new File( pathElement); try { addPathFile(pathComponent); } catch (IOException e) { throw new BuildException(e)...
java
public void addPathElement(String pathElement) throws BuildException { File pathComponent = project != null ? project.resolveFile(pathElement) : new File( pathElement); try { addPathFile(pathComponent); } catch (IOException e) { throw new BuildException(e)...
[ "public", "void", "addPathElement", "(", "String", "pathElement", ")", "throws", "BuildException", "{", "File", "pathComponent", "=", "project", "!=", "null", "?", "project", ".", "resolveFile", "(", "pathElement", ")", ":", "new", "File", "(", "pathElement", ...
Adds an element to the classpath to be searched. @param pathElement The path element to add. Must not be <code>null</code>. @exception BuildException if the given path element cannot be resolved against the project.
[ "Adds", "an", "element", "to", "the", "classpath", "to", "be", "searched", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L454-L462
125,772
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.addPathFile
protected void addPathFile(File pathComponent) throws IOException { if (!pathComponents.contains(pathComponent)) { pathComponents.addElement(pathComponent); } if (pathComponent.isDirectory()) { return; } String absPathPlusTimeAndLength = pathComponent.get...
java
protected void addPathFile(File pathComponent) throws IOException { if (!pathComponents.contains(pathComponent)) { pathComponents.addElement(pathComponent); } if (pathComponent.isDirectory()) { return; } String absPathPlusTimeAndLength = pathComponent.get...
[ "protected", "void", "addPathFile", "(", "File", "pathComponent", ")", "throws", "IOException", "{", "if", "(", "!", "pathComponents", ".", "contains", "(", "pathComponent", ")", ")", "{", "pathComponents", ".", "addElement", "(", "pathComponent", ")", ";", "}...
Add a file to the path. Reads the manifest, if available, and adds any additional class path jars specified in the manifest. @param pathComponent the file which is to be added to the path for this class loader @throws IOException if data needed from the file cannot be read.
[ "Add", "a", "file", "to", "the", "path", ".", "Reads", "the", "manifest", "if", "available", "and", "adds", "any", "additional", "class", "path", "jars", "specified", "in", "the", "manifest", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L488-L539
125,773
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getClasspath
public String getClasspath() { StringBuilder sb = new StringBuilder(); boolean firstPass = true; Enumeration componentEnum = pathComponents.elements(); while (componentEnum.hasMoreElements()) { if (!firstPass) { sb.append(System.getProperty("path.separator"));...
java
public String getClasspath() { StringBuilder sb = new StringBuilder(); boolean firstPass = true; Enumeration componentEnum = pathComponents.elements(); while (componentEnum.hasMoreElements()) { if (!firstPass) { sb.append(System.getProperty("path.separator"));...
[ "public", "String", "getClasspath", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "firstPass", "=", "true", ";", "Enumeration", "componentEnum", "=", "pathComponents", ".", "elements", "(", ")", ";", "while", "(...
Returns the classpath this classloader will consult. @return the classpath used for this classloader, with elements separated by the path separator for the system.
[ "Returns", "the", "classpath", "this", "classloader", "will", "consult", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L547-L560
125,774
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.initializeClass
@Deprecated public static void initializeClass(Class theClass) { // ***HACK*** We ask the VM to create an instance // by voluntarily providing illegal arguments to force // the VM to run the class' static initializer, while // at the same time not running a valid constructor. ...
java
@Deprecated public static void initializeClass(Class theClass) { // ***HACK*** We ask the VM to create an instance // by voluntarily providing illegal arguments to force // the VM to run the class' static initializer, while // at the same time not running a valid constructor. ...
[ "@", "Deprecated", "public", "static", "void", "initializeClass", "(", "Class", "theClass", ")", "{", "// ***HACK*** We ask the VM to create an instance", "// by voluntarily providing illegal arguments to force", "// the VM to run the class' static initializer, while", "// at the same ti...
Forces initialization of a class in a JDK 1.1 compatible, albeit hacky way. @param theClass The class to initialize. Must not be <code>null</code>. @deprecated since 1.6.x. Use Class.forName with initialize=true instead.
[ "Forces", "initialization", "of", "a", "class", "in", "a", "JDK", "1", ".", "1", "compatible", "albeit", "hacky", "way", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L585-L617
125,775
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.forceLoadClass
public Class forceLoadClass(String classname) throws ClassNotFoundException { log("force loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findClass(classname); } return theClass; }
java
public Class forceLoadClass(String classname) throws ClassNotFoundException { log("force loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findClass(classname); } return theClass; }
[ "public", "Class", "forceLoadClass", "(", "String", "classname", ")", "throws", "ClassNotFoundException", "{", "log", "(", "\"force loading \"", "+", "classname", ",", "Project", ".", "MSG_DEBUG", ")", ";", "Class", "theClass", "=", "findLoadedClass", "(", "classn...
Loads a class through this class loader even if that class is available on the parent classpath. This ensures that any classes which are loaded by the returned class will use this classloader. @param classname The name of the class to be loaded. Must not be <code>null</code>. @return the required Class object @exce...
[ "Loads", "a", "class", "through", "this", "class", "loader", "even", "if", "that", "class", "is", "available", "on", "the", "parent", "classpath", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L660-L669
125,776
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.forceLoadSystemClass
public Class forceLoadSystemClass(String classname) throws ClassNotFoundException { log("force system loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findBaseClass(classname); } return theCla...
java
public Class forceLoadSystemClass(String classname) throws ClassNotFoundException { log("force system loading " + classname, Project.MSG_DEBUG); Class theClass = findLoadedClass(classname); if (theClass == null) { theClass = findBaseClass(classname); } return theCla...
[ "public", "Class", "forceLoadSystemClass", "(", "String", "classname", ")", "throws", "ClassNotFoundException", "{", "log", "(", "\"force system loading \"", "+", "classname", ",", "Project", ".", "MSG_DEBUG", ")", ";", "Class", "theClass", "=", "findLoadedClass", "...
Loads a class through this class loader but defer to the parent class loader. This ensures that instances of the returned class will be compatible with instances which have already been loaded on the parent loader. @param classname The name of the class to be loaded. Must not be <code>null</code>. @return the requir...
[ "Loads", "a", "class", "through", "this", "class", "loader", "but", "defer", "to", "the", "parent", "class", "loader", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L687-L696
125,777
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getResourceAsStream
public InputStream getResourceAsStream(String name) { InputStream resourceStream = null; if (isParentFirst(name)) { resourceStream = loadBaseResource(name); } if (resourceStream != null) { log("ResourceStream for " + name + " loaded from parent loa...
java
public InputStream getResourceAsStream(String name) { InputStream resourceStream = null; if (isParentFirst(name)) { resourceStream = loadBaseResource(name); } if (resourceStream != null) { log("ResourceStream for " + name + " loaded from parent loa...
[ "public", "InputStream", "getResourceAsStream", "(", "String", "name", ")", "{", "InputStream", "resourceStream", "=", "null", ";", "if", "(", "isParentFirst", "(", "name", ")", ")", "{", "resourceStream", "=", "loadBaseResource", "(", "name", ")", ";", "}", ...
Returns a stream to read the requested resource name. @param name The name of the resource for which a stream is required. Must not be <code>null</code>. @return a stream to the required resource or <code>null</code> if the resource cannot be found on the loader's classpath.
[ "Returns", "a", "stream", "to", "read", "the", "requested", "resource", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L707-L737
125,778
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.loadResource
private InputStream loadResource(String name) { // we need to search the components of the path to see if we can // find the class we want. InputStream stream = null; Enumeration e = pathComponents.elements(); while (e.hasMoreElements() && stream == null) { File path...
java
private InputStream loadResource(String name) { // we need to search the components of the path to see if we can // find the class we want. InputStream stream = null; Enumeration e = pathComponents.elements(); while (e.hasMoreElements() && stream == null) { File path...
[ "private", "InputStream", "loadResource", "(", "String", "name", ")", "{", "// we need to search the components of the path to see if we can", "// find the class we want.", "InputStream", "stream", "=", "null", ";", "Enumeration", "e", "=", "pathComponents", ".", "elements", ...
Returns a stream to read the requested resource name from this loader. @param name The name of the resource for which a stream is required. Must not be <code>null</code>. @return a stream to the required resource or <code>null</code> if the resource cannot be found on the loader's classpath.
[ "Returns", "a", "stream", "to", "read", "the", "requested", "resource", "name", "from", "this", "loader", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L748-L759
125,779
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getResourceStream
private InputStream getResourceStream(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { ...
java
private InputStream getResourceStream(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { ...
[ "private", "InputStream", "getResourceStream", "(", "File", "file", ",", "String", "resourceName", ")", "{", "try", "{", "JarFile", "jarFile", "=", "(", "JarFile", ")", "jarFiles", ".", "get", "(", "file", ")", ";", "if", "(", "jarFile", "==", "null", "&...
Returns an inputstream to a given resource in the given file which may either be a directory or a zip file. @param file the file (directory or jar) in which to search for the resource. Must not be <code>null</code>. @param resourceName The name of the resource for which a stream is required. Must not be <code>null</co...
[ "Returns", "an", "inputstream", "to", "a", "given", "resource", "in", "the", "given", "file", "which", "may", "either", "be", "a", "directory", "or", "a", "zip", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L787-L817
125,780
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.isParentFirst
private boolean isParentFirst(String resourceName) { // default to the global setting and then see // if this class belongs to a package which has been // designated to use a specific loader first // (this one or the parent one) // TODO shouldn't this always return false in isol...
java
private boolean isParentFirst(String resourceName) { // default to the global setting and then see // if this class belongs to a package which has been // designated to use a specific loader first // (this one or the parent one) // TODO shouldn't this always return false in isol...
[ "private", "boolean", "isParentFirst", "(", "String", "resourceName", ")", "{", "// default to the global setting and then see", "// if this class belongs to a package which has been", "// designated to use a specific loader first", "// (this one or the parent one)", "// TODO shouldn't this ...
Tests whether or not the parent classloader should be checked for a resource before this one. If the resource matches both the "use parent classloader first" and the "use this classloader first" lists, the latter takes priority. @param resourceName The name of the resource to check. Must not be <code>null</code>. @re...
[ "Tests", "whether", "or", "not", "the", "parent", "classloader", "should", "be", "checked", "for", "a", "resource", "before", "this", "one", ".", "If", "the", "resource", "matches", "both", "the", "use", "parent", "classloader", "first", "and", "the", "use",...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L832-L857
125,781
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getRootLoader
private ClassLoader getRootLoader() { ClassLoader ret = getClass().getClassLoader(); while (ret != null && ret.getParent() != null) { ret = ret.getParent(); } return ret; }
java
private ClassLoader getRootLoader() { ClassLoader ret = getClass().getClassLoader(); while (ret != null && ret.getParent() != null) { ret = ret.getParent(); } return ret; }
[ "private", "ClassLoader", "getRootLoader", "(", ")", "{", "ClassLoader", "ret", "=", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ";", "while", "(", "ret", "!=", "null", "&&", "ret", ".", "getParent", "(", ")", "!=", "null", ")", "{", "ret", ...
Used for isolated resource seaching. @return the root classloader of AntClassLoader.
[ "Used", "for", "isolated", "resource", "seaching", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L863-L869
125,782
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.findResources
protected Enumeration/*<URL>*/ findResources(String name, boolean parentHasBeenSearched) throws IOException { Enumeration/*<URL>*/ mine = new ResourceEnumeration(name); Enumeration/*<URL>*/ base; if (parent != null && (!parentHasBeenSearch...
java
protected Enumeration/*<URL>*/ findResources(String name, boolean parentHasBeenSearched) throws IOException { Enumeration/*<URL>*/ mine = new ResourceEnumeration(name); Enumeration/*<URL>*/ base; if (parent != null && (!parentHasBeenSearch...
[ "protected", "Enumeration", "/*<URL>*/", "findResources", "(", "String", "name", ",", "boolean", "parentHasBeenSearched", ")", "throws", "IOException", "{", "Enumeration", "/*<URL>*/", "mine", "=", "new", "ResourceEnumeration", "(", "name", ")", ";", "Enumeration", ...
Returns an enumeration of URLs representing all the resources with the given name by searching the class loader's classpath. @param name The resource name to search for. Must not be <code>null</code>. @param parentHasBeenSearched whether ClassLoader.this.parent has been searched - will be true if the method is (indire...
[ "Returns", "an", "enumeration", "of", "URLs", "representing", "all", "the", "resources", "with", "the", "given", "name", "by", "searching", "the", "class", "loader", "s", "classpath", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L961-L987
125,783
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getResourceURL
protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { tr...
java
protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { tr...
[ "protected", "URL", "getResourceURL", "(", "File", "file", ",", "String", "resourceName", ")", "{", "try", "{", "JarFile", "jarFile", "=", "(", "JarFile", ")", "jarFiles", ".", "get", "(", "file", ")", ";", "if", "(", "jarFile", "==", "null", "&&", "fi...
Returns the URL of a given resource in the given file which may either be a directory or a zip file. @param file The file (directory or jar) in which to search for the resource. Must not be <code>null</code>. @param resourceName The name of the resource for which a stream is required. Must not be <code>null</code>. @...
[ "Returns", "the", "URL", "of", "a", "given", "resource", "in", "the", "given", "file", "which", "may", "either", "be", "a", "directory", "or", "a", "zip", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1001-L1041
125,784
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.loadClass
protected synchronized Class loadClass(String classname, boolean resolve) throws ClassNotFoundException { // 'sync' is needed - otherwise 2 threads can load the same class // twice, resulting in LinkageError: duplicated class definition. // findLoadedClass avoids that, but without sy...
java
protected synchronized Class loadClass(String classname, boolean resolve) throws ClassNotFoundException { // 'sync' is needed - otherwise 2 threads can load the same class // twice, resulting in LinkageError: duplicated class definition. // findLoadedClass avoids that, but without sy...
[ "protected", "synchronized", "Class", "loadClass", "(", "String", "classname", ",", "boolean", "resolve", ")", "throws", "ClassNotFoundException", "{", "// 'sync' is needed - otherwise 2 threads can load the same class", "// twice, resulting in LinkageError: duplicated class definition...
Loads a class with this class loader. This class attempts to load the class in an order determined by whether or not the class matches the system/loader package lists, with the loader package list taking priority. If the classloader is in isolated mode, failure to load the class in this loader will result in a ClassNo...
[ "Loads", "a", "class", "with", "this", "class", "loader", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1063-L1099
125,785
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.defineClassFromData
protected Class defineClassFromData(File container, byte[] classData, String classname) throws IOException { definePackage(container, classname); ProtectionDomain currentPd = Project.class.getProtectionDomain(); String classResource = getClassFilename(classname); CodeSource s...
java
protected Class defineClassFromData(File container, byte[] classData, String classname) throws IOException { definePackage(container, classname); ProtectionDomain currentPd = Project.class.getProtectionDomain(); String classResource = getClassFilename(classname); CodeSource s...
[ "protected", "Class", "defineClassFromData", "(", "File", "container", ",", "byte", "[", "]", "classData", ",", "String", "classname", ")", "throws", "IOException", "{", "definePackage", "(", "container", ",", "classname", ")", ";", "ProtectionDomain", "currentPd"...
Define a class given its bytes @param container the container from which the class data has been read may be a directory or a jar/zip file. @param classData the bytecode data for the class @param classname the name of the class @return the Class instance created from the given data @throws IOException if the class ...
[ "Define", "a", "class", "given", "its", "bytes" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1127-L1141
125,786
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.definePackage
protected void definePackage(File container, String className) throws IOException { int classIndex = className.lastIndexOf('.'); if (classIndex == -1) { return; } String packageName = className.substring(0, classIndex); if (getPackage(packageName) != null) { ...
java
protected void definePackage(File container, String className) throws IOException { int classIndex = className.lastIndexOf('.'); if (classIndex == -1) { return; } String packageName = className.substring(0, classIndex); if (getPackage(packageName) != null) { ...
[ "protected", "void", "definePackage", "(", "File", "container", ",", "String", "className", ")", "throws", "IOException", "{", "int", "classIndex", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "classIndex", "==", "-", "1", ")",...
Define the package information associated with a class. @param container the file containing the class definition. @param className the class name of for which the package information is to be determined. @exception IOException if the package information cannot be read from the container.
[ "Define", "the", "package", "information", "associated", "with", "a", "class", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1153-L1171
125,787
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getJarManifest
private Manifest getJarManifest(File container) throws IOException { if (container.isDirectory()) { return null; } JarFile jarFile = (JarFile) jarFiles.get(container); if (jarFile == null) { return null; } return jarFile.getManifest(); }
java
private Manifest getJarManifest(File container) throws IOException { if (container.isDirectory()) { return null; } JarFile jarFile = (JarFile) jarFiles.get(container); if (jarFile == null) { return null; } return jarFile.getManifest(); }
[ "private", "Manifest", "getJarManifest", "(", "File", "container", ")", "throws", "IOException", "{", "if", "(", "container", ".", "isDirectory", "(", ")", ")", "{", "return", "null", ";", "}", "JarFile", "jarFile", "=", "(", "JarFile", ")", "jarFiles", "....
Get the manifest from the given jar, if it is indeed a jar and it has a manifest @param container the File from which a manifest is required. @return the jar's manifest or null is the container is not a jar or it has no manifest. @exception IOException if the manifest cannot be read.
[ "Get", "the", "manifest", "from", "the", "given", "jar", "if", "it", "is", "indeed", "a", "jar", "and", "it", "has", "a", "manifest" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1184-L1193
125,788
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getCertificates
private Certificate[] getCertificates(File container, String entry) throws IOException { if (container.isDirectory()) { return null; } JarFile jarFile = (JarFile) jarFiles.get(container); if (jarFile == null) { return null; } JarEntry ent =...
java
private Certificate[] getCertificates(File container, String entry) throws IOException { if (container.isDirectory()) { return null; } JarFile jarFile = (JarFile) jarFiles.get(container); if (jarFile == null) { return null; } JarEntry ent =...
[ "private", "Certificate", "[", "]", "getCertificates", "(", "File", "container", ",", "String", "entry", ")", "throws", "IOException", "{", "if", "(", "container", ".", "isDirectory", "(", ")", ")", "{", "return", "null", ";", "}", "JarFile", "jarFile", "=...
Get the certificates for a given jar entry, if it is indeed a jar. @param container the File from which to read the entry @param entry the entry of which the certificates are requested @return the entry's certificates or null is the container is not a jar or it has no certificates. @exception IOException if the mani...
[ "Get", "the", "certificates", "for", "a", "given", "jar", "entry", "if", "it", "is", "indeed", "a", "jar", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1206-L1217
125,789
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.definePackage
protected void definePackage(File container, String packageName, Manifest manifest) { String sectionName = packageName.replace('.', '/') + "/"; String specificationTitle = null; String specificationVendor = null; String specificationVersion = null; String implementationTitle = n...
java
protected void definePackage(File container, String packageName, Manifest manifest) { String sectionName = packageName.replace('.', '/') + "/"; String specificationTitle = null; String specificationVendor = null; String specificationVersion = null; String implementationTitle = n...
[ "protected", "void", "definePackage", "(", "File", "container", ",", "String", "packageName", ",", "Manifest", "manifest", ")", "{", "String", "sectionName", "=", "packageName", ".", "replace", "(", "'", "'", ",", "'", "'", ")", "+", "\"/\"", ";", "String"...
Define the package information when the class comes from a jar with a manifest @param container the jar file containing the manifest @param packageName the name of the package being defined. @param manifest the jar's manifest
[ "Define", "the", "package", "information", "when", "the", "class", "comes", "from", "a", "jar", "with", "a", "manifest" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1227-L1282
125,790
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.getClassFromStream
private Class getClassFromStream(InputStream stream, String classname, File container) throws IOException, SecurityException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bytesRead = -1; byte[] buffer = new byte[BUFFER_SIZE]; while ((bytesRead = stream.read...
java
private Class getClassFromStream(InputStream stream, String classname, File container) throws IOException, SecurityException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bytesRead = -1; byte[] buffer = new byte[BUFFER_SIZE]; while ((bytesRead = stream.read...
[ "private", "Class", "getClassFromStream", "(", "InputStream", "stream", ",", "String", "classname", ",", "File", "container", ")", "throws", "IOException", ",", "SecurityException", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ...
Reads a class definition from a stream. @param stream The stream from which the class is to be read. Must not be <code>null</code>. @param classname The name of the class in the stream. Must not be <code>null</code>. @param container the file or directory containing the class. @return the Class object read from the s...
[ "Reads", "a", "class", "definition", "from", "a", "stream", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1300-L1311
125,791
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.findClass
public Class findClass(String name) throws ClassNotFoundException { log("Finding class " + name, Project.MSG_DEBUG); return findClassInComponents(name); }
java
public Class findClass(String name) throws ClassNotFoundException { log("Finding class " + name, Project.MSG_DEBUG); return findClassInComponents(name); }
[ "public", "Class", "findClass", "(", "String", "name", ")", "throws", "ClassNotFoundException", "{", "log", "(", "\"Finding class \"", "+", "name", ",", "Project", ".", "MSG_DEBUG", ")", ";", "return", "findClassInComponents", "(", "name", ")", ";", "}" ]
Searches for and load a class on the classpath of this class loader. @param name The name of the class to be loaded. Must not be <code>null</code>. @return the required Class object @exception ClassNotFoundException if the requested class does not exist on this loader's classpath.
[ "Searches", "for", "and", "load", "a", "class", "on", "the", "classpath", "of", "this", "class", "loader", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1324-L1327
125,792
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.findClassInComponents
private Class findClassInComponents(String name) throws ClassNotFoundException { // we need to search the components of the path to see if // we can find the class we want. String classFilename = getClassFilename(name); Enumeration e = pathComponents.elements(); while (e....
java
private Class findClassInComponents(String name) throws ClassNotFoundException { // we need to search the components of the path to see if // we can find the class we want. String classFilename = getClassFilename(name); Enumeration e = pathComponents.elements(); while (e....
[ "private", "Class", "findClassInComponents", "(", "String", "name", ")", "throws", "ClassNotFoundException", "{", "// we need to search the components of the path to see if", "// we can find the class we want.", "String", "classFilename", "=", "getClassFilename", "(", "name", ")"...
Finds a class on the given classpath. @param name The name of the class to be loaded. Must not be <code>null</code>. @return the required Class object @exception ClassNotFoundException if the requested class does not exist on this loader's classpath.
[ "Finds", "a", "class", "on", "the", "given", "classpath", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1351-L1374
125,793
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.cleanup
public synchronized void cleanup() { for (Enumeration e = jarFiles.elements(); e.hasMoreElements();) { JarFile jarFile = (JarFile) e.nextElement(); try { jarFile.close(); } catch (IOException ioe) { // ignore } } jar...
java
public synchronized void cleanup() { for (Enumeration e = jarFiles.elements(); e.hasMoreElements();) { JarFile jarFile = (JarFile) e.nextElement(); try { jarFile.close(); } catch (IOException ioe) { // ignore } } jar...
[ "public", "synchronized", "void", "cleanup", "(", ")", "{", "for", "(", "Enumeration", "e", "=", "jarFiles", ".", "elements", "(", ")", ";", "e", ".", "hasMoreElements", "(", ")", ";", ")", "{", "JarFile", "jarFile", "=", "(", "JarFile", ")", "e", "....
Cleans up any resources held by this classloader. Any open archive files are closed.
[ "Cleans", "up", "any", "resources", "held", "by", "this", "classloader", ".", "Any", "open", "archive", "files", "are", "closed", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1399-L1413
125,794
jenkinsci/jenkins
core/src/main/java/jenkins/util/AntClassLoader.java
AntClassLoader.addJavaLibraries
public void addJavaLibraries() { Vector packages = JavaEnvUtils.getJrePackages(); Enumeration e = packages.elements(); while (e.hasMoreElements()) { String packageName = (String) e.nextElement(); addSystemPackageRoot(packageName); } }
java
public void addJavaLibraries() { Vector packages = JavaEnvUtils.getJrePackages(); Enumeration e = packages.elements(); while (e.hasMoreElements()) { String packageName = (String) e.nextElement(); addSystemPackageRoot(packageName); } }
[ "public", "void", "addJavaLibraries", "(", ")", "{", "Vector", "packages", "=", "JavaEnvUtils", ".", "getJrePackages", "(", ")", ";", "Enumeration", "e", "=", "packages", ".", "elements", "(", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ...
add any libraries that come with different java versions here
[ "add", "any", "libraries", "that", "come", "with", "different", "java", "versions", "here" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/AntClassLoader.java#L1519-L1526
125,795
jenkinsci/jenkins
core/src/main/java/hudson/logging/LogRecorder.java
LogRecorder.doDoDelete
@RequirePOST public synchronized void doDoDelete(StaplerResponse rsp) throws IOException, ServletException { getConfigFile().delete(); getParent().logRecorders.remove(name); // Disable logging for all our targets, // then reenable all other loggers in case any also log the same targe...
java
@RequirePOST public synchronized void doDoDelete(StaplerResponse rsp) throws IOException, ServletException { getConfigFile().delete(); getParent().logRecorders.remove(name); // Disable logging for all our targets, // then reenable all other loggers in case any also log the same targe...
[ "@", "RequirePOST", "public", "synchronized", "void", "doDoDelete", "(", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "getConfigFile", "(", ")", ".", "delete", "(", ")", ";", "getParent", "(", ")", ".", "logRecorders", ...
Deletes this recorder, then go back to the parent.
[ "Deletes", "this", "recorder", "then", "go", "back", "to", "the", "parent", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/logging/LogRecorder.java#L382-L394
125,796
jenkinsci/jenkins
core/src/main/java/hudson/logging/LogRecorder.java
LogRecorder.getSlaveLogRecords
public Map<Computer,List<LogRecord>> getSlaveLogRecords() { Map<Computer,List<LogRecord>> result = new TreeMap<Computer,List<LogRecord>>(new Comparator<Computer>() { final Collator COLL = Collator.getInstance(); public int compare(Computer c1, Computer c2) { return COLL.c...
java
public Map<Computer,List<LogRecord>> getSlaveLogRecords() { Map<Computer,List<LogRecord>> result = new TreeMap<Computer,List<LogRecord>>(new Comparator<Computer>() { final Collator COLL = Collator.getInstance(); public int compare(Computer c1, Computer c2) { return COLL.c...
[ "public", "Map", "<", "Computer", ",", "List", "<", "LogRecord", ">", ">", "getSlaveLogRecords", "(", ")", "{", "Map", "<", "Computer", ",", "List", "<", "LogRecord", ">", ">", "result", "=", "new", "TreeMap", "<", "Computer", ",", "List", "<", "LogRec...
Gets a view of log records per agent matching this recorder. @return a map (sorted by display name) from computer to (nonempty) list of log records @since 1.519
[ "Gets", "a", "view", "of", "log", "records", "per", "agent", "matching", "this", "recorder", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/logging/LogRecorder.java#L422-L453
125,797
jenkinsci/jenkins
core/src/main/java/hudson/lifecycle/Lifecycle.java
Lifecycle.get
public synchronized static Lifecycle get() { if(INSTANCE==null) { Lifecycle instance; String p = SystemProperties.getString("hudson.lifecycle"); if(p!=null) { try { ClassLoader cl = Jenkins.getInstance().getPluginManager().uberClassLoader; ...
java
public synchronized static Lifecycle get() { if(INSTANCE==null) { Lifecycle instance; String p = SystemProperties.getString("hudson.lifecycle"); if(p!=null) { try { ClassLoader cl = Jenkins.getInstance().getPluginManager().uberClassLoader; ...
[ "public", "synchronized", "static", "Lifecycle", "get", "(", ")", "{", "if", "(", "INSTANCE", "==", "null", ")", "{", "Lifecycle", "instance", ";", "String", "p", "=", "SystemProperties", ".", "getString", "(", "\"hudson.lifecycle\"", ")", ";", "if", "(", ...
Gets the singleton instance. @return never null
[ "Gets", "the", "singleton", "instance", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/lifecycle/Lifecycle.java#L58-L112
125,798
jenkinsci/jenkins
core/src/main/java/hudson/lifecycle/Lifecycle.java
Lifecycle.rewriteHudsonWar
public void rewriteHudsonWar(File by) throws IOException { File dest = getHudsonWar(); // this should be impossible given the canRewriteHudsonWar method, // but let's be defensive if(dest==null) throw new IOException("jenkins.war location is not known."); // backing up the old ...
java
public void rewriteHudsonWar(File by) throws IOException { File dest = getHudsonWar(); // this should be impossible given the canRewriteHudsonWar method, // but let's be defensive if(dest==null) throw new IOException("jenkins.war location is not known."); // backing up the old ...
[ "public", "void", "rewriteHudsonWar", "(", "File", "by", ")", "throws", "IOException", "{", "File", "dest", "=", "getHudsonWar", "(", ")", ";", "// this should be impossible given the canRewriteHudsonWar method,", "// but let's be defensive", "if", "(", "dest", "==", "n...
Replaces jenkins.war by the given file. <p> On some system, most notably Windows, a file being in use cannot be changed, so rewriting {@code jenkins.war} requires some special trick. Override this method to do so.
[ "Replaces", "jenkins", ".", "war", "by", "the", "given", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/lifecycle/Lifecycle.java#L137-L154
125,799
jenkinsci/jenkins
core/src/main/java/jenkins/security/s2m/ConfigFile.java
ConfigFile.load2
public synchronized void load2() throws IOException { COL result = create(); if (exists()) { try (LinesStream stream = linesStream()) { for (String line : stream) { if (line.startsWith("#")) continue; // comment T r = parse(line); ...
java
public synchronized void load2() throws IOException { COL result = create(); if (exists()) { try (LinesStream stream = linesStream()) { for (String line : stream) { if (line.startsWith("#")) continue; // comment T r = parse(line); ...
[ "public", "synchronized", "void", "load2", "(", ")", "throws", "IOException", "{", "COL", "result", "=", "create", "(", ")", ";", "if", "(", "exists", "(", ")", ")", "{", "try", "(", "LinesStream", "stream", "=", "linesStream", "(", ")", ")", "{", "f...
Loads the configuration from the configuration file. @throws IOException if the configuration file could not be read. @since 2.111
[ "Loads", "the", "configuration", "from", "the", "configuration", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/s2m/ConfigFile.java#L55-L70