private String[] getRepositoryPaths(String[] paths) throws SVNException { if (paths == null || paths.length == 0) { return paths; } String[] fullPaths = new String[paths.length]; for (int i = 0; i < paths.length; i++) { fullPaths[i] = getLocationRelativePath(paths[i]); } return fullPaths; }
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; }
String path = (String) paths.next(); Long revision = (Long) pathsToRevisions.get(path); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"lock", path, comment, Boolean.valueOf(force), revision}; write("(w(s(s)w(n)))", buffer);
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; }
String path = (String) paths.next(); String id = (String) pathToTokens.get(path); path = getLocationRelativePath(path); if (id == null) { Object[] buffer = new Object[]{"get-lock", path};
public SVNNodeKind checkPath(String path, long revision) throws SVNException { try { openConnection(); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"check-path", path, getRevisionObject(revision)}; write("(w(s(n)))", buffer); authenticate(); List values = read("w", null, false); return SVNNodeKind.parseKind(SVNReader.getString(values, 0)); } catch (SVNException e) { closeSession(); throw e; } finally { closeConnection(); } }
protected void getInheritedPropertiesImpl(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException { try { openConnection(); path = getLocationRelativePath(path); write("(w(s(n)))", new Object[] { "get-iprops", path, revision }); authenticate();
try { openConnection(); Object[] buffer = new Object[]{"get-file", getLocationRelativePath(path), rev, Boolean.valueOf(properties != null), Boolean.valueOf(contents != null)}; write("(w(s(n)ww))", buffer);
buffer = new Object[2]; for (Iterator paths = pathsToRevisions.keySet().iterator(); paths.hasNext();) { buffer[0] = getLocationRelativePath((String) paths.next()); buffer[1] = pathsToRevisions.get(buffer[0]); write("(s(n))", buffer);
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; }
String fullPath = getFullPath(path); SVNURL url = getLocation().setPath(fullPath, false); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"stat", path, getRevisionObject(revision)}; write("(w(s(n)))", buffer);
try { openConnection(); path = getLocationRelativePath(path); Object[] buffer = new Object[]{"get-locations", path, getRevisionObject(pegRevision), revisions}; write("(w(sn(*n)))", buffer);
try { openConnection(); path = getLocationRelativePath(path); Object[] buffer = new Object[] { "get-location-segments", path, getRevisionObject(pegRevision), getRevisionObject(startRevision), getRevisionObject(endRevision) };
openConnection(); Object[] buffer = new Object[]{"get-file-revs", getLocationRelativePath(path), srev, erev, Boolean.toString(includeMergedRevisions)}; write("(w(s(n)(n)w))", buffer);