// Hack: When creating a file, if the actual contents are passed first,
// the client hangs for about 20 seconds when closing the InputStream.
// Don't know why...
// But, if the file is created with empty contents, and then the contents
// set, the operation is fast (less than a couple of seconds)
res = client.createResource(fullPath, new ByteArrayInputStream(new byte[0]), false);
if (res) {
client.putResource(fullPath, selectedFile.getContents());
}
} catch (WebDavException wde) {
if (wde.getErrorCode() != IResponse.SC_UNAUTHORIZED) {