OAuthClient client = new OAuthClient(new HttpClient3());
OAuthAccessor accessor = buildAccessor();
OAuthMessage request = accessor.newRequestMessage(OAuthMessage.GET, endpointUrl + "Invoices" + "/" + invoiceId, null);
request.getHeaders().add(new OAuth.Parameter("Accept", "application/pdf"));
OAuthResponseMessage response = client.access(request, ParameterStyle.BODY);
file = new File("Invoice-" + invoiceId + ".pdf");
if (response != null && response.getHttpResponse() != null && (response.getHttpResponse().getStatusCode() / 2) != 2) {