public HttpInputStream head(String url, boolean failIfNotOK, String user, String pass) throws IOException { return head(url, failIfNotOK, user, pass, null, null, null); }
public HttpInputStream head(String url, boolean failIfNotOK, UsernamePasswordCredentials creds) throws IOException { return head(url, failIfNotOK, creds, null, null, null); }
public HttpInputStream head(String url, boolean failIfNotOK, String user, String pass) throws IOException { return head(url, failIfNotOK, user, pass, null, null, null); }
public HttpInputStream head(String url, boolean failIfNotOK, UsernamePasswordCredentials creds) throws IOException { return head(url, failIfNotOK, creds, null, null, null); }
public HttpInputStream head(String url, boolean failIfNotOK, String user, String pass, String ifNoneMatch, String ifModifiedSince, String range) throws IOException { UsernamePasswordCredentials creds = null; if (user != null && !user.isEmpty() && pass != null && !pass.isEmpty()) creds = new UsernamePasswordCredentials(user, pass); return head(url, failIfNotOK, creds, ifNoneMatch, ifModifiedSince, range); }
public HttpInputStream head(String url, boolean failIfNotOK, String user, String pass, String ifNoneMatch, String ifModifiedSince, String range) throws IOException { UsernamePasswordCredentials creds = null; if (user != null && !user.isEmpty() && pass != null && !pass.isEmpty()) creds = new UsernamePasswordCredentials(user, pass); return head(url, failIfNotOK, creds, ifNoneMatch, ifModifiedSince, range); }
@Test public void testPassthroughHeadMethod() throws HttpServiceNotFoundException, GeneralException, IOException, RangeNotSatisfiableException { mockResponseFor("HEAD"); when(mockClient.head(TEST_URL, true, null, null, null, null, null)) .thenReturn(mockResponse); testObj.getExternalContent(mockParams); verify(mockClient).head(TEST_URL, true, null, null, null, null, null); }
@Test public void testConditionalHeadETagMethod() throws HttpServiceNotFoundException, GeneralException, IOException, RangeNotSatisfiableException { mockResponseFor("HEAD",304); when(mockClient.head(TEST_URL, true, null, null, "LOL", null, null)) .thenReturn(mockResponse); when(mockContext.getHeaderValue(HttpHeaders.IF_NONE_MATCH)).thenReturn("LOL"); MIMETypedStream out = testObj.getExternalContent(mockParams); verify(mockClient).head(TEST_URL, true, null, null, "LOL", null, null); assertEquals(304, out.getStatusCode()); }
try { if (headOnly) { response = m_http.head(url, true, user, pass, context.getHeaderValue(HttpHeaders.IF_NONE_MATCH), context.getHeaderValue(HttpHeaders.IF_MODIFIED_SINCE),
try { if (headOnly) { response = m_http.head(url, true, user, pass, context.getHeaderValue(HttpHeaders.IF_NONE_MATCH), context.getHeaderValue(HttpHeaders.IF_MODIFIED_SINCE),