Skip to content

Commit

Permalink
Header request
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 committed Jun 18, 2023
1 parent 7d1c312 commit 5997be3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,18 @@ public DownloadResponse download(String downloadFrom, Map<String, String> header

/**
* Download headers and return specific header if exists
*
* @param downloadFrom - path to specific artifact in Artifactory.
* @param headerName - specific header name to return if exists.
* @param headerName - specific header name to return if exists.
* @return - header's string value to return.
*/
public String downloadHeader(String downloadFrom, String headerName) throws IOException {
Header[] headers = downloadHeaders(downloadFrom);
for (Header header : headers) {
if (header.getName().equals(headerName)) {
return header.getValue();
if (headers != null) {
for (Header header : headers) {
if (header.getName().equals(headerName)) {
return header.getValue();
}
}
}
return StringUtils.EMPTY;
Expand Down

0 comments on commit 5997be3

Please sign in to comment.