Using tomcat webdav, currently I am able to upload files/documents into a particular webdav location. To this extent, it is fine.
However now I have a requirement that I have to create a new directory (based on a condition) in the webdav location and upload the files or documents into that newly created directory.
This I have to achieve through Java.
I tried to create a directory using file.mkdir(). But it is returning false to me.
Can anyone throw some light how can I overcome this situation?
Kind regards
Subbu
Make an HTTP connection to your WebDAV service and issue a MKCOL request (MKCOL is just like GET, POST, etc.). Something like this:
You should expect a 201 response. If you get something else, it means that the directory creation has failed.