* @throws SVNException
*/
public long doSwitch(File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException {
SVNWCAccess wcAccess = createWCAccess();
try {
SVNAdminAreaInfo info = wcAccess.openAnchor(file, true, SVNWCAccess.INFINITE_DEPTH);
final SVNReporter reporter = new SVNReporter(info, file, true, recursive, getDebugLog());
SVNAdminArea anchorArea = info.getAnchor();
SVNEntry entry = anchorArea.getEntry(anchorArea.getThisDirName(), false);
if (entry == null) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNVERSIONED_RESOURCE, "''{0}'' is not under version control", anchorArea.getRoot());