return result;\r
}\r
\r
- public int tryToLogin() {\r
- int r = 0;\r
- HeadMethod head = new HeadMethod(mUri.toString());\r
+ /**\r
+ * Tries to log in to the given WedDavURI, with the given credentials\r
+ * @param uri To test\r
+ * @param username Username to check\r
+ * @param password Password to verify\r
+ * @return A {@link HttpStatus}-Code of the result. SC_OK is good.\r
+ */\r
+ public int tryToLogin(Uri uri, String username, String password) {\r
+ int returnCode = 0;\r
+ setCredentials(username, password);\r
+ HeadMethod head = new HeadMethod(uri.toString());\r
try {\r
- r = executeMethod(head);\r
+ returnCode = executeMethod(head);\r
} catch (Exception e) {\r
Log.e(TAG, "Error: " + e.getMessage());\r
}\r
- return r;\r
+ return returnCode;\r
}\r
\r
public boolean createDirectory(String path) {\r