Skip to content

Commit

Permalink
Merge pull request #121 from jenkinsci/dependabot/maven/org.jenkins-c…
Browse files Browse the repository at this point in the history
…i.plugins-plugin-4.33

Bump plugin from 4.24 to 4.33
  • Loading branch information
rsandell authored Jan 21, 2022
2 parents dd6987f + 416cdaa commit a0ad7e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
13 changes: 4 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.24</version>
<version>4.33</version>
<relativePath />
</parent>
<artifactId>pipeline-utility-steps</artifactId>
Expand Down Expand Up @@ -58,7 +58,7 @@
<properties>
<revision>2.11.1</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.222.4</jenkins.version>
<jenkins.version>2.289.3</jenkins.version>
<java.level>8</java.level>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>true</spotbugs.failOnError>
Expand Down Expand Up @@ -136,16 +136,11 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.222.x</artifactId>
<version>887.vae9c8ac09ff7</version>
<artifactId>bom-2.289.x</artifactId>
<version>1117.v62a_f6a_01de98</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package org.jenkinsci.plugins.pipeline.utility.steps.fs;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Set;
Expand Down Expand Up @@ -146,9 +147,12 @@ protected FileWrapper run() throws Exception {
final FilePath ws = this.getContext().get(FilePath.class);
assert ws != null;
final FilePath file = ws.child(this.step.getFile());
if (!file.exists()) {
file.getParent().mkdirs();
FilePath parent = file.getParent();
if (!file.exists() && parent != null) {
parent.mkdirs();
file.touch(System.currentTimeMillis());
} else if (parent == null) {
throw new IOException("No parent path for " + file.getRemote());
}
final String content = this.step.getContent();
final String originalContent = file.readToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;

import java.io.IOException;
import java.util.Collections;
import java.util.Set;

Expand Down Expand Up @@ -143,7 +144,12 @@ protected FileWrapper run() throws Exception {
assert ws != null;
FilePath file = ws.child(step.getFile());
long timestamp = step.getTimestamp() != null ? step.getTimestamp() : System.currentTimeMillis();
file.getParent().mkdirs();
final FilePath parent = file.getParent();
if (parent != null) {
parent.mkdirs();
} else {
throw new IOException("No parent path for " + file.getRemote());
}
file.touch(timestamp);
return new FileWrapper(file);
}
Expand Down

0 comments on commit a0ad7e3

Please sign in to comment.