[Yanel-development] Being Offline re SVN Repo implementation
Josias Thöny
josias.thoeny at wyona.com
Thu Nov 30 11:01:34 CET 2006
On Thu, 2006-11-30 at 08:31 +0100, Michael Wechner wrote:
> Hi
>
> It would be nice if the SVN repo implementation could check if one is
> being offline.
>
> There seems like Java 1.5 is offering something like this. Also see
>
> http://ant.apache.org/manual-rc/CoreTasks/conditions.html (isreachable,
> offline).
>
> Does Java 1.4 also provide network probing?
>
> Or can we at least implement a switch within Yanel/Yarep such that it
> knows if it can or not can connect to remote servers?
To test the network connection might not always be appropriate, because
it's possible to have a local subversion repository without http access
(using the svn:// or the file:// protocol).
Maybe we could catch and handle the execption like this:
try {
do svn up
} catch (SVNException e) {
if (e.getErrorMessage().gerErrorCode() == SVNErrorCode.RA_DAV_REQUEST_FAILED) {
log.warn("svn repository not available: entering offline mode");
isOffline = true;
} else {
throw e; // cannot recover
}
}
WDYT?
Josias
>
> Thanks
>
> Michi
>
More information about the Yanel-development
mailing list