Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-24380] Updated to handle proposed new build directory format.
  • Loading branch information
jglick committed Dec 15, 2014
1 parent dd8b916 commit ffb47e1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java
Expand Up @@ -612,13 +612,24 @@ private static class ItemsContent extends PrintedContent {
int builds = 0;
// protected access: File buildDir = j.getBuildDir();
File buildDir = Jenkins.getInstance().getBuildDirFor(j);
boolean newFormat = new File(buildDir, "legacyIds").isFile(); // JENKINS-24380
File[] buildDirs = buildDir.listFiles();
if (buildDirs != null) {
for (File d : buildDirs) {
if (mayBeDate(d.getName())) {
String name = d.getName();
if (newFormat) {
try {
Integer.parseInt(name);
if (d.isDirectory()) {
builds++;
}
} catch (NumberFormatException x) {
// something else
}
} else /* legacy format */if (mayBeDate(name)) {
// check for real
try {
BUILD_FORMAT.parse(d.getName());
BUILD_FORMAT.parse(name);
if (d.isDirectory()) {
builds++;
}
Expand Down

0 comments on commit ffb47e1

Please sign in to comment.