public boolean isEnoent() { SVNErrorCode errorCode = getErrorMessage().getErrorCode(); return errorCode == SVNErrorCode.ENTRY_NOT_FOUND || errorCode == SVNErrorCode.FS_NOT_FOUND || errorCode == SVNErrorCode.FS_NOT_OPEN || errorCode == SVNErrorCode.FS_NOT_FILE; } }
private static void handleInconsistentEOL(SVNException svne, String path) throws SVNException { if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.IO_INCONSISTENT_EOL) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "File ''{0}'' has inconsistent newlines", path); SVNErrorManager.error(error, SVNLogType.DEFAULT); } else { throw svne; } } }
private void fixError(String path, SVNException e, SVNNodeKind kind) throws SVNException { SVNErrorMessage err = e.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.FS_NOT_FOUND || err.getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) { err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, kind == SVNNodeKind.DIR ? "Directory ''{0}'' is out of date" : "File ''{0}'' is out of date", path); throw new SVNException(err); } throw e; }
/** * Wraps this error message into a new one that is returned as * a parent error message. A parent message is set the error code * of this error message, a new error description and this error * message as its child. * * @param parentMessage a parent error description * @return a parent error message */ public SVNErrorMessage wrap(String parentMessage){ SVNErrorMessage parentError = SVNErrorMessage.create(this.getErrorCode(), parentMessage); parentError.setChildErrorMessage(this); return parentError; }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); }
public long getDatedRevision(Date date) throws SVNException { date = date == null ? new Date(System.currentTimeMillis()) : date; DAVDateRevisionHandler handler = new DAVDateRevisionHandler(); StringBuffer request = DAVDateRevisionHandler.generateDateRevisionRequest(null, date); try { openConnection(); DAVConnection connection = getConnection(); String path = getReportTarget(connection); HTTPStatus status = connection.doReport(path, request, handler); if (status.getError() != null) { if (status.getError().getErrorCode() == SVNErrorCode.UNSUPPORTED_FEATURE) { SVNErrorMessage err2 = SVNErrorMessage.create(status.getError().getErrorCode(), "Server does not support date-based operations"); SVNErrorManager.error(err2, status.getError(), SVNLogType.NETWORK); } SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } } finally { closeConnection(); } return handler.getRevisionNumber(); }
public static FSNodeHistory getNodeHistory(FSRevisionRoot root, String path) throws SVNException { FSRevisionNode node = null; SVNNodeKind kind = null; try { node = root.openPath(path, true, false).getRevNode(); } catch (SVNException svne) { if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { kind = SVNNodeKind.NONE; } throw svne; } kind = node.getType(); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(root, path)); } return new FSNodeHistory(new SVNLocationEntry(root.getRevision(), path), false, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null)); }
private void handleUnsupportedCommand(SVNException e, String message) throws SVNException { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_SVN_UNKNOWN_CMD) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, message); SVNErrorManager.error(err, e.getErrorMessage(), SVNLogType.NETWORK); } throw e; }
public static boolean isErrorAccess(SVNException e) { final SVNErrorCode errorCode = e.getErrorMessage().getErrorCode(); return errorCode == SVNErrorCode.FS_NOT_FOUND; }
/** * Wraps this error message into a new one that is returned as * a parent error message. A parent message is set the error code * of this error message, a new error description and this error * message as its child. * * @param parentMessage a parent error description * @return a parent error message */ public SVNErrorMessage wrap(String parentMessage){ SVNErrorMessage parentError = SVNErrorMessage.create(this.getErrorCode(), parentMessage); parentError.setChildErrorMessage(this); return parentError; }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); } }
private void fixError(String path, SVNException e, SVNNodeKind kind) throws SVNException { SVNErrorMessage err = e.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.FS_NOT_FOUND || err.getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) { err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, kind == SVNNodeKind.DIR ? "Directory ''{0}'' is out of date" : "File ''{0}'' is out of date", path); throw new SVNException(err); } throw e; }
public long getDatedRevision(Date date) throws SVNException { date = date == null ? new Date(System.currentTimeMillis()) : date; DAVDateRevisionHandler handler = new DAVDateRevisionHandler(); StringBuffer request = DAVDateRevisionHandler.generateDateRevisionRequest(null, date); try { openConnection(); String path = getLocation().getURIEncodedPath(); path = DAVUtil.getVCCPath(myConnection, this, path); HTTPStatus status = myConnection.doReport(path, request, handler); if (status.getError() != null) { if (status.getError().getErrorCode() == SVNErrorCode.UNSUPPORTED_FEATURE) { SVNErrorMessage err2 = SVNErrorMessage.create(status.getError().getErrorCode(), "Server does not support date-based operations"); SVNErrorManager.error(err2, status.getError()); } SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } return handler.getRevisionNumber(); }
private void handleUnsupportedCommand(SVNException e, String message) throws SVNException { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_SVN_UNKNOWN_CMD) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, message); SVNErrorManager.error(err, e.getErrorMessage(), e, SVNLogType.NETWORK); } throw e; }
public SVNLock getLockHelper(String repositoryPath, boolean haveWriteLock) throws SVNException { SVNLock lock = null; try { lock = getLock(repositoryPath, haveWriteLock, false); } catch (SVNException svne) { if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NO_SUCH_LOCK || svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_LOCK_EXPIRED) { return null; } throw svne; } return lock; }
/** * Wraps this error message into a new one that is returned as * a parent error message. A parent message is set the error code * of this error message, a new error description and this error * message as its child. * * @param parentMessage a parent error description * @return a parent error message */ public SVNErrorMessage wrap(String parentMessage){ SVNErrorMessage parentError = SVNErrorMessage.create(this.getErrorCode(), parentMessage); parentError.setChildErrorMessage(this); return parentError; }
public void handleError(File path, SVNErrorMessage error) throws SVNException { while (error.hasChildErrorMessage()) { error = error.getChildErrorMessage(); } if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND || error.getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) { return; } SVNErrorManager.error(error, SVNLogType.DEFAULT); } }
private void fixError(String path, SVNException e, SVNNodeKind kind) throws SVNException { SVNErrorMessage err = e.getErrorMessage(); if (err.getErrorCode() == SVNErrorCode.FS_NOT_FOUND || err.getErrorCode() == SVNErrorCode.RA_DAV_PATH_NOT_FOUND) { err = SVNErrorMessage.create(SVNErrorCode.WC_NOT_UP_TO_DATE, kind == SVNNodeKind.DIR ? "Directory ''{0}'' is out of date" : "File ''{0}'' is out of date", path); throw new SVNException(err); } throw e; }
private void handleUnsupportedCommand(SVNException e, String message) throws SVNException { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_SVN_UNKNOWN_CMD) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, message); SVNErrorManager.error(err, e.getErrorMessage()); } throw e; } }
public SVNLock getLockHelper(String repositoryPath, boolean haveWriteLock) throws SVNException { SVNLock lock = null; try { lock = getLock(repositoryPath, haveWriteLock, false); } catch (SVNException svne) { if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NO_SUCH_LOCK || svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_LOCK_EXPIRED) { return null; } throw svne; } return lock; }