If I understood what you're asking .... can't you just have another class / function check path found in the url request?

ie
1) extract the path from the url
2) check if the path exists in the file system
2) if the path doesn't currently exist, this class / function will create the path....


Just call this function before you call the putMethod function. I believe commons io has this function already made for you if you don't feel like doing it yourself.

Zoltan wrote:

Hello,



I have the following snippet of code:



           String url = "http://"+ serverName + ":" + slidePort +
"/slide/files/";

HttpURL hrl = new HttpURL(url);

           WebdavResource wdr = new WebdavResource(hrl);

           File fn = new File(fileName);

           String path = url + fn.getName();

           wdr.putMethod(path, fn);

           wdr.close();



This successfully uploads the given file to the Slide server (under
slide/files).

How should I modify the above code to be able to upload the file in a
subfolder of slide/files? (something like
slide/files/folderA/folderB/filename).




In other words: is there a way to programmatically create folders under
slide/files?



Thanks in advance for your response,

Zoltan






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to