-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-53361 Copy files using a regular expression #13
Conversation
this.from = from; | ||
this.into = into; | ||
this.filterRegex = filterRegex; | ||
this.filterBy = filterBy; | ||
if(Util.fixEmpty(filterRegex) != null && Util.fixEmpty(filterBy) == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space after the if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied formatter, which also added braces.
8203a5e. Thank you.
@@ -106,7 +116,7 @@ public GetCallable(GetStep step, TaskListener listener, String into) { | |||
|
|||
@Override | |||
public Object execute() { | |||
return getService().get(((GetStep) getStep()).getFrom(), into); | |||
return getService().get(((GetStep) getStep()).getFrom(), into, ((GetStep) getStep()).getFilterBy(), ((GetStep) getStep()).getFilterRegex()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a variable for step
and just get and cast it once rather than 3 times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with 8203a5e. Thank you.
this.from = from; | ||
this.into = into; | ||
this.filterRegex = filterRegex; | ||
this.filterBy = filterBy; | ||
if(Util.fixEmpty(filterRegex) != null && Util.fixEmpty(filterBy) == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied formatter, which also added braces.
8203a5e. Thank you.
@@ -98,7 +108,7 @@ public PutCallable(PutStep step, TaskListener listener, String from) { | |||
|
|||
@Override | |||
public Object execute() { | |||
return getService().put(from, ((PutStep) getStep()).getInto()); | |||
return getService().put(from, ((PutStep) getStep()).getInto(), ((PutStep) getStep()).getFilterBy(), ((PutStep) getStep()).getFilterRegex()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with 8203a5e. Thank you.
@@ -285,6 +285,14 @@ Put a file or directory into the remote host. | |||
|String, *Mandatory* | |||
|file or directory path on the remote node. | |||
|
|||
|filterBy | |||
|String, *Optional*, Defaults to `name`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it support filtering by that other than name? I'm suggesting to condense these two to one property for now: filterByName, then document it's a regex based filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried all the options, but yes it does support all the params those are available on the File object, like path
, absolutePath
, file
, directory
, parent
, parentFile
and so on..
Mostly all the params on the File object http://docs.groovy-lang.org/docs/latest/html/groovy-jdk/java/io/File.html
Description
Copy files using a regular expression
See JENKINS-53361.