views:

313

answers:

0

Hi, We have URLs to a list of documents and we would like to check if a user is authorized to view those documents. Since the server requires NTLM authentication, we are using the JCIFS API to make a URL Connection to the document and checking the HTTP response code. If the response code is 401, then we are confirming that user does not have access. However, I think there are lot of HTTP Response codes that start with 2, 3, 4 and 5. I would like to understand what we do if we receive any response code that starts with 3?

Config.setProperty("jcifs.smb.client.username", "");
Config.setProperty("jcifs.smb.client.password", "");
URL spURL = new URL("http:////"; HttpURLConnection httpURLConnection = (HttpURLConnection) spURL .openConnection(); NtlmHttpURLConnection ntlmHttpURLConnection = new NtlmHttpURLConnection( httpURLConnection); int resCode = ntlmHttpURLConnection.getResponseCode()