Skip to content

Commit

Permalink
Allow directory and regular file to be passed to etag properties
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-kraemer committed Oct 4, 2020
1 parent c87acb0 commit eee9aa2
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,8 @@ private File getDestinationFromDirProperty(Object dir) {

@Override
public void downloadTaskDir(Object dir) {
if (dir instanceof Closure) {
//lazily evaluate closure
Closure<?> closure = (Closure<?>)dir;
dir = closure.call();
}

dir = tryGetProvider(dir);

if (dir instanceof CharSequence) {
this.downloadTaskDir = projectApi.file(dir.toString());
} else if (dir instanceof File) {
this.downloadTaskDir = (File)dir;
} else {
downloadTaskDir = getDestinationFromDirProperty(dir);
if (downloadTaskDir == null) {
throw new IllegalArgumentException("download-task directory must " +
"either be a File or a CharSequence");
}
Expand Down Expand Up @@ -988,6 +977,8 @@ public void cachedETagsFile(Object location) {

if (location instanceof CharSequence) {
this.cachedETagsFile = projectApi.file(location.toString());
} else if (isRegularFile(location)) {
this.cachedETagsFile = getFileFromRegularFile(location);
} else if (location instanceof File) {
this.cachedETagsFile = (File)location;
} else {
Expand Down

0 comments on commit eee9aa2

Please sign in to comment.