- * Creates a remote directory with the received path.
- *
- * @param path Path of the directory to create, URL DECODED
- * @return 'True' when the directory is successfully created
- */
- public boolean createDirectory(String path) {
- boolean result = false;
- int status = -1;
- MkColMethod mkcol = new MkColMethod(mUri.toString() + WebdavUtils.encodePath(path));
- try {
- Log_OC.d(TAG, "Creating directory " + path);
- status = executeMethod(mkcol);
- Log_OC.d(TAG, "Status returned: " + status);
- result = mkcol.succeeded();
-
- Log_OC.d(TAG, "MKCOL to " + path + " finished with HTTP status " + status + (!result?"(FAIL)":""));
- exhaustResponse(mkcol.getResponseBodyAsStream());
-
- } catch (Exception e) {
- logException(e, "creating directory " + path);
-
- } finally {
- mkcol.releaseConnection(); // let the connection available for other methods
- }
- return result;
- }
-
-
- /**