X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/53bc15cdbf41c0df50404fa2163521beeb07042f..8ba2ca7b8556de4aea4a7a8407a204b4dcfca34c:/src/eu/alefzero/webdav/WebdavClient.java diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index 939a22d3..bd58fcc2 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -252,6 +252,23 @@ Log.e("ASD", ""+username); } return true; } + + + /** + * Check if a file exists in the OC server + * + * @return 'Boolean.TRUE' if the file exists; 'Boolean.FALSE' it doesn't exist; NULL if couldn't be checked + */ + public Boolean existsFile(String path) { + try { + HeadMethod head = new HeadMethod(mUri.toString() + WebdavUtils.encodePath(path)); + int status = executeMethod(head); + return (status == HttpStatus.SC_OK); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } /**