How to use SharpSVN to (quickly) check if a remote folder/file exists on the server

Posted by Ziphnor on Stack Overflow See other posts from Stack Overflow or by Ziphnor
Published on 2010-03-08T18:04:26Z Indexed on 2010/03/08 18:06 UTC
Read the original article Hit count: 609

Filed under:

Say i have a svn repository at https://www.mysvn.com/svn/. How can i use SharpSVN to figure out whether the remote folder https://www.mysvn.com/svn/a/b/c exists on the server?

I need to do it an a way that allows me to tell the difference between a failed connection (ie server down) and the folder simply not having been created yet.

Calling info on the full https://www.mysvn.com/svn/a/b/c path does not seem to give an exception that enables me to tell the difference between no repository at all and just a missing folder.

I could list all files for https://www.mysvn.com/svn/ but the repository can easily be so big that this can take too long.

Right now im doing an info on first the root url and then on the full url. If the root url fails i treat it as a server problem, but if it succeeds and the full url fails i assume its because part of the path hasnt been created on the server.

© Stack Overflow or respective owner

Related posts about svn