Skip to content

Commit

Permalink
#1 - add filename() method on DownloadItem.
Browse files Browse the repository at this point in the history
  • Loading branch information
sherriff committed Jul 14, 2015
1 parent 748eee7 commit d4a3216
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class DownloadItem {
public String url;
public String username;
public String password;
public String filename;
private String filename;

public MavenMetadata metadata;

Expand All @@ -28,6 +28,16 @@ public DownloadItem(String url, String username, String password, MavenMetadata
this.metadata = metadata;
}

public String filename() {
if (filename != null) {
return filename;
}
if (metadata != null) {
return metadata.filename();
}
return null;
}

@Override
public String toString() {
return "DownloadItem{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ private MavenMetadata() {
}

public MavenMetadata(String groupId, String artifactId, String version) {
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
this(groupId, artifactId, version, "jar");
}
public MavenMetadata(String groupId, String artifactId, String version, String packaging) {
this.groupId = groupId;
Expand Down

0 comments on commit d4a3216

Please sign in to comment.