@@ -43,7 +43,7 @@ public BuildArtifactAction(Run<?, ?> build, String actionID) {
4343 }
4444
4545 public String getActionID (){
46- return this .actionID ;
46+ return ( this . actionID == null ) ? "" : this .actionID ;
4747 }
4848
4949 @ CheckForNull
@@ -61,14 +61,19 @@ public String getDisplayName() {
6161 @ CheckForNull
6262 @ Override
6363 public String getUrlName () {
64- return "buildresults" + this .actionID ;
64+ return ( this . actionID == null ) ? "buildresults" : "buildresults" + this .actionID ;
6565 }
6666
6767 public List <BuildArtifactData > getBuildArtifact () throws ParseException , InterruptedException , IOException {
6868 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+ }
7277 try (InputStreamReader reader = new InputStreamReader (new FileInputStream (new File (fl .toURI ())), "UTF-8" )) {
7378 Object obj = new JSONParser ().parse (reader );
7479 JSONObject jo = (JSONObject ) obj ;
@@ -139,7 +144,14 @@ public void setOwner(Run owner) {
139144
140145 private void setCounts () throws InterruptedException , ParseException {
141146 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+ }
143155 try (InputStreamReader reader = new InputStreamReader (new FileInputStream (new File (fl .toURI ())), "UTF-8" )) {
144156 Object obj = new JSONParser ().parse (reader );
145157 JSONObject jo = (JSONObject ) obj ;
0 commit comments