X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/53bc15cdbf41c0df50404fa2163521beeb07042f..3e2d5f40b4cf14e7de2688eadb7ec0a6b8473329:/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; + } + } /**