public HTTPStatus doReport(String path, StringBuffer requestBody, DefaultHandler handler) throws SVNException { return doReport(path, requestBody, handler, false); }
public HTTPStatus doReport(String path, StringBuffer requestBody, DefaultHandler handler) throws SVNException { return doReport(path, requestBody, handler, false); }
public HTTPStatus doReport(String path, StringBuffer requestBody, DefaultHandler handler) throws SVNException { return doReport(path, requestBody, handler, false); }
public HTTPStatus doReport(String path, StringBuffer requestBody, DefaultHandler handler) throws SVNException { return doReport(path, requestBody, handler, false); }
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 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(); }
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(); DAVConnection connection = getConnection(); path = DAVUtil.getVCCPath(connection, this, path); 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 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(); DAVConnection connection = getConnection(); path = DAVUtil.getVCCPath(connection, this, path); 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 void status(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVEditorHandler.generateEditorRequest(myConnection, null, getLocation().toString(), revision, target, null, recursive, false, false, false, reporter); DAVEditorHandler handler = new DAVEditorHandler(editor, false); String path = SVNEncodingUtil.uriEncode(getLocation().getPath()); path = DAVUtil.getVCCPath(myConnection, this, path); HTTPStatus status = myConnection.doReport(path, request, handler); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } }
public void update(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVEditorHandler.generateEditorRequest(myConnection, null, getLocation().toString(), revision, target, null, recursive, false, false, true, reporter); DAVEditorHandler handler = new DAVEditorHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); try { bcPath = DAVUtil.getVCCPath(myConnection, this, bcPath); } catch (SVNException e) { // no need to call close edit here, I suppose, // no editing has been started yet. throw e; } HTTPStatus status = myConnection.doReport(bcPath, request, handler); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); DAVConnection connection = getConnection(); String thisSessionPath = doGetFullPath(""); thisSessionPath = SVNEncodingUtil.uriEncode(thisSessionPath); DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, thisSessionPath, pegRevision, false, false, null); String finalBCPath = SVNPathUtil.append(info.baselineBase, info.baselinePath); StringBuffer requestBody = DAVDeletedRevisionHandler.generateGetDeletedRevisionRequest(null, path, pegRevision, endRevision); DAVDeletedRevisionHandler handler = new DAVDeletedRevisionHandler(); HTTPStatus status = connection.doReport(finalBCPath, requestBody, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'get-deleted-rev' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } return handler.getRevision(); } finally { closeConnection(); } }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); DAVConnection connection = getConnection(); String thisSessionPath = doGetFullPath(""); thisSessionPath = SVNEncodingUtil.uriEncode(thisSessionPath); DAVBaselineInfo info = DAVUtil.getStableURL(connection, this, thisSessionPath, pegRevision, false, false, null); String finalBCPath = SVNPathUtil.append(info.baselineBase, info.baselinePath); StringBuffer requestBody = DAVDeletedRevisionHandler.generateGetDeletedRevisionRequest(null, path, pegRevision, endRevision); DAVDeletedRevisionHandler handler = new DAVDeletedRevisionHandler(); HTTPStatus status = connection.doReport(finalBCPath, requestBody, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'get-deleted-rev' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } return handler.getRevision(); } finally { closeConnection(); } }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); DAVConnection connection = getConnection(); String thisSessionPath = doGetFullPath(""); thisSessionPath = SVNEncodingUtil.uriEncode(thisSessionPath); DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, thisSessionPath, pegRevision, false, false, null); String finalBCPath = SVNPathUtil.append(info.baselineBase, info.baselinePath); StringBuffer requestBody = DAVDeletedRevisionHandler.generateGetDeletedRevisionRequest(null, path, pegRevision, endRevision); DAVDeletedRevisionHandler handler = new DAVDeletedRevisionHandler(); HTTPStatus status = connection.doReport(finalBCPath, requestBody, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'get-deleted-rev' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } return handler.getRevision(); } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVReplayHandler.generateReplayRequest(highRevision, lowRevision, sendDeltas); DAVReplayHandler handler = new DAVReplayHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); DAVConnection connection = getConnection(); HTTPStatus status = connection.doReport(bcPath, request, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'replay' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } else if (status.getError() != null) { SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVReplayHandler.generateReplayRequest(highRevision, lowRevision, sendDeltas); DAVReplayHandler handler = new DAVReplayHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); DAVConnection connection = getConnection(); HTTPStatus status = connection.doReport(bcPath, request, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'replay' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } else if (status.getError() != null) { SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVReplayHandler.generateReplayRequest(highRevision, lowRevision, sendDeltas); DAVReplayHandler handler = new DAVReplayHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); DAVConnection connection = getConnection(); HTTPStatus status = connection.doReport(bcPath, request, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'replay' REPORT not implemented"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } else if (status.getError() != null) { SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { try { openConnection(); StringBuffer request = DAVReplayHandler.generateReplayRequest(highRevision, lowRevision, sendDeltas); DAVReplayHandler handler = new DAVReplayHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); try { bcPath = DAVUtil.getVCCPath(myConnection, this, bcPath); } catch (SVNException e) { throw e; } HTTPStatus status = myConnection.doReport(bcPath, request, handler); if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "'replay' REPORT not implemented"); SVNErrorManager.error(err, status.getError()); } else if (status.getError() != null) { SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } }
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { if (url == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, "URL could not be NULL"); SVNErrorManager.error(err); } if (revision < 0) { revision = targetRevision; } try { openConnection(); StringBuffer request = DAVEditorHandler.generateEditorRequest(myConnection, null, getLocation().toString(), targetRevision, target, url.toString(), recursive, ignoreAncestry, false, getContents, reporter); DAVEditorHandler handler = new DAVEditorHandler(editor, true); String path = SVNEncodingUtil.uriEncode(getLocation().getPath()); path = DAVUtil.getVCCPath(myConnection, this, path); HTTPStatus status = myConnection.doReport(path, request, handler, true); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } }
public void update(SVNURL url, long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException { if (url == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, "URL could not be NULL"); SVNErrorManager.error(err); } try { openConnection(); StringBuffer request = DAVEditorHandler.generateEditorRequest(myConnection, null, getLocation().toString(), revision, target, url.toString(), recursive, true, false, true, reporter); DAVEditorHandler handler = new DAVEditorHandler(editor, true); String bcPath = SVNEncodingUtil.uriEncode(getLocation().getPath()); try { bcPath = DAVUtil.getVCCPath(myConnection, this, bcPath); } catch (SVNException e) { editor.closeEdit(); throw e; } HTTPStatus status = myConnection.doReport(bcPath, request, handler); if (status.getError() != null) { SVNErrorManager.error(status.getError()); } } finally { closeConnection(); } }
public SVNLock[] doGetLocks(String path) throws SVNException { DAVGetLocksHandler handler = new DAVGetLocksHandler(); HTTPStatus status = null; try { status = doReport(path, DAVGetLocksHandler.generateGetLocksRequest(null), handler); } catch (SVNException e) { if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.UNSUPPORTED_FEATURE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "Server does not support locking features"); SVNErrorManager.error(err, e.getErrorMessage(), e, SVNLogType.NETWORK); } else if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { return new SVNLock[0]; } throw e; } if (status.getCode() == 501) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "Server does not support locking features"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } else if (status.getCode() == HttpURLConnection.HTTP_NOT_FOUND) { return new SVNLock[0]; } else if (status.getError() != null && status.getError().getErrorCode() == SVNErrorCode.UNSUPPORTED_FEATURE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_IMPLEMENTED, "Server does not support locking features"); SVNErrorManager.error(err, status.getError(), SVNLogType.NETWORK); } else if (status.getError() != null) { SVNErrorManager.error(status.getError(), SVNLogType.NETWORK); } return handler.getLocks(); }