private String getUrlString(SVNURL url) { if (url == null) { return null; } return url.toString(); }
private byte[] getRepositoryRoot() throws UnsupportedEncodingException { if (repositoryRoot == null) { if (repositoryRootUrl != null) { repositoryRoot = repositoryRootUrl.toString().getBytes("UTF-8"); } } return repositoryRoot; }
private byte[] getUrl() throws UnsupportedEncodingException { if (url == null) { if (locationUrl != null) { url = expand ? locationUrl.toString().getBytes("UTF-8") : url; } } return url; }
private byte[] getBaseUrl() throws UnsupportedEncodingException, SVNException { if (baseUrl == null) { if (locationUrl != null) { baseUrl = locationUrl.removePathTail().toString().getBytes("UTF-8"); } } return baseUrl; }
private void checkReposMatch(SVNURL reposRootUrl, File localAbsPath, SVNURL url) throws SVNException { if (!SVNPathUtil.isAncestor(reposRootUrl.toString(), url.toString())) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "URL ''{0}'' of ''{1}'' is not in repository ''{2}''", url, localAbsPath, reposRootUrl); SVNErrorManager.error(errorMessage, SVNLogType.WC); } }
public void linkPath(SVNURL url, String path, String lockToken, long revison, boolean startEmpty) throws SVNException { String rootURL = SVNPathUtil.getCommonURLAncestor(url.toString(), myRepositoryLocation); if (rootURL.length() < myRepositoryLocation.length()) { myRepositoryLocation = rootURL; } myReporter.linkPath(url, path, lockToken, revison, startEmpty); }
private String getItemKey(SvnCommitItem item, SVNURL rootURL, boolean combinePackets) throws SVNException { if (combinePackets) { return rootURL.toString(); } final File wcRoot = SvnOperationFactory.getWorkingCopyRoot(item.getKind() == SVNNodeKind.FILE ? item.getPath().getParentFile() : item.getPath(), true); return rootURL.toString() + ":" + wcRoot.getAbsolutePath(); }
public void handleDirEntry( SVNDirEntry svnDirEntry ) throws SVNException { infos.put( svnDirEntry.getName(), svnDirEntry.getURL().toString() ); } }
public String getReposRootUrl() throws ClientException { try { final SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); return repositoryRoot.toString(); } catch (SVNException e) { throw ClientException.fromException(e); } }
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { assertValidRevision(revision); write("(w(ssnw(s)w))", new Object[]{"link-path", path, url.toString(), getRevisionObject(revision), Boolean.valueOf(startEmpty), lockToken, SVNDepth.asString(depth)}); }
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { assertValidRevision(revision); write("(w(ssnw(s)w))", new Object[]{"link-path", path, url.toString(), getRevisionObject(revision), Boolean.valueOf(startEmpty), lockToken, SVNDepth.asString(depth)}); }
public void update(SVNURL url, long revision, String target, SVNDepth depth, 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, SVNLogType.NETWORK); } runReport(getLocation(), revision, target, url.toString(), depth, true, false, true, false, true, true, false, null, reporter, editor); }
public void update(SVNURL url, long revision, String target, SVNDepth depth, 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, SVNLogType.NETWORK); } runReport(getLocation(), revision, target, url.toString(), depth, true, false, true, false, true, true, false, reporter, editor); }
public static String createSVNRepository(File directory) throws IOException, SVNException { clean(directory); SVNURL url = SVNRepositoryFactory.createLocalRepository(directory, true , false); return url.toString(); } }
@Override public URI getUri() { SVNURL svnurl; svnurl = getSvnurl(); try { svnurl = SVNURL.create(svnurl.getProtocol(), null, svnurl.getHost(), svnurl.hasPort() ? svnurl.getPort() : -1, svnurl.getPath(), false); } catch (SVNException e) { throw new IllegalStateException(e.getMessage(), e); } return URI.create(root.getFilesystem().getScheme() + ":" + svnurl.toString()); }
public SVNURL convertHttpToFile(SVNURL url) throws SVNException { String uri = DAVPathUtil.addLeadingSlash(url.getURIEncodedPath()); if (!uri.startsWith(getResourceContext())) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Invalid URL ''{0}'' requested", url.toString()), SVNLogType.NETWORK); } return SVNURL.parseURIEncoded(getResourceRepositoryRoot() + getRepositoryRelativePath(url)); }
private static ConflictVersion createConflictVersion(SVNConflictVersion version) { if (version == null) { return null; } String url = version.getRepositoryRoot() != null ? version.getRepositoryRoot().toString() : null; return new ConflictVersion(url, version.getPegRevision(), version.getPath(), getNodeKind(version.getKind())); }
private static ConflictVersion createConflictVersion(SVNConflictVersion version) { if (version == null) { return null; } String url = version.getRepositoryRoot() != null ? version.getRepositoryRoot().toString() : null; return new ConflictVersion(url, version.getPegRevision(), version.getPath(), getNodeKind(version.getKind())); }
private void openRepository() throws SVNException { try { openRepositoryRoot(); } catch (SVNException svne) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_LOCAL_REPOS_OPEN_FAILED, "Unable to connect to a repository at URL ''{0}''", getLocation().toString()); err.setChildErrorMessage(svne.getErrorMessage()); SVNErrorManager.error(err.wrap("Unable to open repository ''{0}''", new Object[]{getLocation()}), SVNLogType.FSFS); } }