You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by "Shah, Kalpesh" <Ka...@softwareagusa.com> on 2002/08/27 22:17:03 UTC

Create New file.

Hi,

Is there a way in slide client by which I can specify to create a new file.
It should throw an 
exception or return false if file already exists.

I want to create a file as it is in java.io.File, which will return false if
file already exists.

Documentation of webDavResource class says that equivalent of createNewFile(
) is put,
but how do I avoid so that it does not overwrite the existing file ?

Thanks in advance.
-Kalpesh.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Create New file.

Posted by A Felix <te...@yahoo.com>.
 I think this will need one HEAD request and one PUT,
 something like,

 a) send HEAD /path/file
 b) if status is 404, PUT /path/file
    else
      return false

 hope it helps!
 -af


--- "Shah, Kalpesh" <Ka...@softwareagusa.com>
wrote:
> Hi,
> 
> Is there a way in slide client by which I can
> specify to create a new file.
> It should throw an 
> exception or return false if file already exists.
> 
> I want to create a file as it is in java.io.File,
> which will return false if
> file already exists.
> 
> Documentation of webDavResource class says that
> equivalent of createNewFile(
> ) is put,
> but how do I avoid so that it does not overwrite the
> existing file ?
> 
> Thanks in advance.
> -Kalpesh.
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>