public SVNLock[] getLocks(String path) throws SVNException { try { openConnection(); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"get-locks", path}; write("(w(s))", buffer); authenticate(); List items = read("l", null, false); items = (List) items.get(0); Collection locks = new ArrayList(); for (Iterator iterator = items.iterator(); iterator.hasNext();) { SVNItem item = (SVNItem) iterator.next(); if (item.getKind() != SVNItem.LIST) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Lock element not a list"); SVNErrorManager.error(err, SVNLogType.NETWORK); } SVNLock lock = SVNReader.getLock(item.getItems()); if (lock != null) { locks.add(lock); } } return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock[] getLocks(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[]{"get-locks", path}; write("(w(s))", buffer); authenticate(); List items = read("l", null, false); items = (List) items.get(0); Collection locks = new ArrayList(); for (Iterator iterator = items.iterator(); iterator.hasNext();) { SVNItem item = (SVNItem) iterator.next(); if (item.getKind() != SVNItem.LIST) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Lock element not a list"); SVNErrorManager.error(err, SVNLogType.NETWORK); } SVNLock lock = SVNReader.getLock(item.getItems()); locks.add(lock); } return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock[] getLocks(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[] { "get-locks", path }; write("(w(s))", buffer); authenticate(); read("[((*L))]", buffer, true); Collection lockObjects = (Collection) buffer[0]; return lockObjects == null ? new SVNLock[0] : (SVNLock[]) lockObjects.toArray(new SVNLock[lockObjects.size()]); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock[] getLocks(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[]{"get-locks", path}; write("(w(s))", buffer); authenticate(); List items = read("l", null, false); items = (List) items.get(0); Collection locks = new ArrayList(); for (Iterator iterator = items.iterator(); iterator.hasNext();) { SVNItem item = (SVNItem) iterator.next(); if (item.getKind() != SVNItem.LIST) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Lock element not a list"); SVNErrorManager.error(err, SVNLogType.NETWORK); } SVNLock lock = SVNReader.getLock(item.getItems()); if (lock != null) { locks.add(lock); } } return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock getLock(String path) throws SVNException { try { openConnection(); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"get-lock", path}; write("(w(s))", buffer); authenticate(); List items = read("(?l)", null, false); items = (List) items.get(0); return SVNReader.getLock(items); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock getLock(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[]{"get-lock", path}; write("(w(s))", buffer); authenticate(); List items = read("(?l)", null, false); items = (List) items.get(0); return SVNReader.getLock(items); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public SVNLock getLock(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[]{"get-lock", path}; write("(w(s))", buffer); authenticate(); List items = read("(?l)", null, false); items = (List) items.get(0); return SVNReader.getLock(items); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[] { "replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas) }; try { openConnection(); write("(w(nnw))", buffer); authenticate(); read("*E", new Object[] { editor }, true); // write("(w())", new Object[] {"success"}); read("[()]", null, true); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException { Object[] buffer = new Object[]{"replay", getRevisionObject(highRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnw))", buffer); authenticate(); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); read("", null, false); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the replay command"); } finally { closeConnection(); } }
public SVNLock getLock(String path) throws SVNException { try { openConnection(); path = getRepositoryPath(path); Object[] buffer = new Object[] { "get-lock", path }; write("(w(s))", buffer); authenticate(); read("[((?L))]", buffer, true); return (SVNLock) buffer[0]; } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "Server doesn't support the get-lock command"); } finally { closeConnection(); } return null; }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); Long srev = getRevisionObject(pegRevision); Long erev = getRevisionObject(endRevision); Object[] buffer = new Object[] { "get-deleted-rev", path, srev, erev }; write("(w(snn))", buffer); authenticate(); List values = read("r", null, false); return SVNReader.getLong(values, 0); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'get-deleted-rev' not implemented"); } finally { closeConnection(); } return INVALID_REVISION; }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); Long srev = getRevisionObject(pegRevision); Long erev = getRevisionObject(endRevision); Object[] buffer = new Object[] { "get-deleted-rev", path, srev, erev }; write("(w(snn))", buffer); authenticate(); List values = read("r", null, false); return SVNReader.getLong(values, 0); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'get-deleted-rev' not implemented"); } finally { closeConnection(); } return INVALID_REVISION; }
protected long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException { try { openConnection(); path = getLocationRelativePath(path); Long srev = getRevisionObject(pegRevision); Long erev = getRevisionObject(endRevision); Object[] buffer = new Object[] { "get-deleted-rev", path, srev, erev }; write("(w(snn))", buffer); authenticate(); List<?> values = read("r", null, false); return SVNReader.getLong(values, 0); } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'get-deleted-rev' not implemented"); } finally { closeConnection(); } return INVALID_REVISION; }
protected void replayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) throws SVNException { Object[] buffer = new Object[]{"replay-range", getRevisionObject(startRevision), getRevisionObject(endRevision), getRevisionObject(lowRevision), Boolean.valueOf(sendDeltas)}; try { openConnection(); write("(w(nnnw))", buffer); authenticate(); for (long rev = startRevision; rev <= endRevision; rev++) { List items = readTuple("wl", false); String word = SVNReader.getString(items, 0); if (!"revprops".equals(word)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Expected ''revprops'', found ''{0}''", word); SVNErrorManager.error(err, SVNLogType.NETWORK); } SVNProperties revProps = SVNReader.getProperties(items, 1, null); ISVNEditor editor = handler.handleStartRevision(rev, revProps); SVNEditModeReader editReader = new SVNEditModeReader(myConnection, editor, true); editReader.driveEditor(); handler.handleEndRevision(rev, revProps, editor); } read("", null, false); } catch (SVNException svne) { closeSession(); handleUnsupportedCommand(svne, "Server doesn't support the replay-range command"); } finally { closeConnection(); } }
} catch (SVNException svne) { closeSession(); handleUnsupportedCommand(svne, "Server doesn't support the replay-range command"); } finally { closeConnection();
} catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'stat' not implemented"); } finally { closeConnection();
} catch (SVNException svne) { closeSession(); handleUnsupportedCommand(svne, "Server doesn't support the replay-range command"); } finally { closeConnection();
public SVNDirEntry info(String path, long revision) throws SVNException { try { openConnection(); String fullPath = getFullPath(path); SVNURL url = getLocation().setPath(fullPath, false); path = getRepositoryPath(path); Object[] buffer = new Object[] { "stat", path, getRevisionObject(revision) }; write("(w(s(n)))", buffer); authenticate(); read("[((?F))]", buffer, true); SVNDirEntry entry = (SVNDirEntry) buffer[0]; if (entry != null) { entry = new SVNDirEntry(url, SVNPathUtil.tail(path), entry.getKind(), entry.getSize(), entry.hasProperties(), entry.getRevision(), entry.getDate(), entry.getAuthor()); } return entry; } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'stat' not implemented"); } finally { closeConnection(); } return null; }