*/
@Override
public DocumentSignedLocation[] getDocumentContentUrls(String[] documentLinks) throws DocumentServiceException {
AuthenticationToken token = this.store.getUserToken();
if (token == null) {
throw new DocumentServiceException("Service requires authentication.");
}
try {
DocumentSignedLocation[] dsls = new DocumentSignedLocation[documentLinks.length];
for (int i=0; i<documentLinks.length; i++) {
String documentUrl = documentLinks[i];
String documentUrlSig;
documentUrlSig = AuthSubUtil.formAuthorizationHeader(
token.getToken(), AuthenticationKey.getAuthSubKey(), new URL(documentUrl), "GET");
DocumentSignedLocation dsl =
new DocumentSignedLocation(documentUrl, documentUrlSig);
dsls[i] = dsl;
}
return dsls;
} catch (Exception e) {
e.printStackTrace();
throw new DocumentServiceException(e.getMessage());
}
}