[hadoop-swift] Added auth check before getData call

Without such check client doesn't try to authenticate during method call.
This leads to read failure in case if this is the first use of client.

Change-Id: Ib2389a83b4e73fac49066ffe0411ff430482f848
Closes-Bug: #1284906
This commit is contained in:
Andrew Lazarev 2014-02-25 16:58:49 -08:00
parent 3ba0ee2a1f
commit fab9840abf
1 changed files with 3 additions and 0 deletions

View File

@ -637,6 +637,7 @@ public final class SwiftRestClient {
LOG.debug("getData:" + range);
}
preRemoteCommand("getData");
return getData(url,
new Header(HEADER_RANGE, range),
SwiftRestClient.NEWEST);
@ -656,6 +657,7 @@ public final class SwiftRestClient {
public HttpBodyContent getData(SwiftObjectPath path,
long offset,
long length) throws IOException {
preRemoteCommand("getData");
return getData(pathToURI(path), offset, length);
}
@ -708,6 +710,7 @@ public final class SwiftRestClient {
public HttpBodyContent getData(SwiftObjectPath path,
final Header... requestHeaders)
throws IOException {
preRemoteCommand("getData");
return getData(pathToURI(path), requestHeaders);
}