@@ -43,7 +43,7 @@ public BuildArtifactAction(Run<?, ?> build, String actionID) {
43
43
}
44
44
45
45
public String getActionID (){
46
- return this .actionID ;
46
+ return ( this . actionID == null ) ? "" : this .actionID ;
47
47
}
48
48
49
49
@ CheckForNull
@@ -61,14 +61,19 @@ public String getDisplayName() {
61
61
@ CheckForNull
62
62
@ Override
63
63
public String getUrlName () {
64
- return "buildresults" + this .actionID ;
64
+ return ( this . actionID == null ) ? "buildresults" : "buildresults" + this .actionID ;
65
65
}
66
66
67
67
public List <BuildArtifactData > getBuildArtifact () throws ParseException , InterruptedException , IOException {
68
68
List <BuildArtifactData > artifactData = new ArrayList <BuildArtifactData >();
69
-
70
- FilePath fl = new FilePath (new File (build .getRootDir ().getAbsolutePath () + "/" +
71
- BUILD_ARTIFACT_FILE + this .actionID + ".json" ));
69
+ FilePath fl ;
70
+ if (this .actionID == null ){
71
+ fl = new FilePath (new File (build .getRootDir ().getAbsolutePath () + "/" +
72
+ BUILD_ARTIFACT_FILE + ".json" ));
73
+ } else {
74
+ fl = new FilePath (new File (build .getRootDir ().getAbsolutePath () + "/" +
75
+ BUILD_ARTIFACT_FILE + this .actionID + ".json" ));
76
+ }
72
77
try (InputStreamReader reader = new InputStreamReader (new FileInputStream (new File (fl .toURI ())), "UTF-8" )) {
73
78
Object obj = new JSONParser ().parse (reader );
74
79
JSONObject jo = (JSONObject ) obj ;
@@ -139,7 +144,14 @@ public void setOwner(Run owner) {
139
144
140
145
private void setCounts () throws InterruptedException , ParseException {
141
146
List <BuildArtifactData > artifactData = new ArrayList <BuildArtifactData >();
142
- FilePath fl = new FilePath (new File (build .getRootDir (), BUILD_ARTIFACT_FILE + this .actionID + ".json" ));
147
+ FilePath fl ;
148
+ if (this .actionID == null ){
149
+ fl = new FilePath (new File (build .getRootDir ().getAbsolutePath () + "/" +
150
+ BUILD_ARTIFACT_FILE + ".json" ));
151
+ } else {
152
+ fl = new FilePath (new File (build .getRootDir ().getAbsolutePath () + "/" +
153
+ BUILD_ARTIFACT_FILE + this .actionID + ".json" ));
154
+ }
143
155
try (InputStreamReader reader = new InputStreamReader (new FileInputStream (new File (fl .toURI ())), "UTF-8" )) {
144
156
Object obj = new JSONParser ().parse (reader );
145
157
JSONObject jo = (JSONObject ) obj ;
0 commit comments