private String getCopyFromPath(SVNURL url) { if (url == null) { return null; } String path = url.getPath(); if (myRepositoryRoot.equals(path)) { return "/"; } return path.substring(myRepositoryRoot.length()); }
/** * Helper function to generate the full path for injecting into URLs and URIs. * * @return the directory path (from svn) pus the file. */ protected String getFullPath() { final StringBuffer buffer = new StringBuffer(remoteRepository.getPath().length() + 1 + getFilename().length()); buffer.append(remoteRepository.getPath()).append('/').append(getFilename()); return buffer.toString(); }
/** * Returns the name of this copy source. * @return copy source name */ public String getName() { if (isURL()) { return SVNPathUtil.tail(myURL.getPath()); } return myPath.getName(); }
/** * Returns the name of this copy source. * @return copy source name */ public String getName() { if (isURL()) { return SVNPathUtil.tail(myURL.getPath()); } return myPath.getName(); }
public String getReposRelativePath(String urlString) throws ClientException { try { final SVNURL url = SVNURL.parseURIEncoded(urlString); final SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); return SVNPathUtil.getPathAsChild(repositoryRoot.getPath(), url.getPath()); } catch (SVNException e) { throw ClientException.fromException(e); } }
public DAVResource(ISVNWorkspaceMediator mediator, DAVConnection connection, String path, long revision, boolean isCopy) { myPath = path; myMediator = mediator; String locationPath = SVNEncodingUtil.uriEncode(connection.getLocation().getPath()); myURL = SVNPathUtil.append(locationPath, path); myRevision = revision; myConnection = connection; myIsCopy = isCopy; }
public DAVResource(ISVNWorkspaceMediator mediator, DAVConnection connection, String path, long revision, boolean isCopy) { myPath = path; myMediator = mediator; String locationPath = SVNEncodingUtil.uriEncode(connection.getLocation().getPath()); myURL = SVNPathUtil.append(locationPath, path); myRevision = revision; myConnection = connection; myIsCopy = isCopy; }
public DAVResource(ISVNWorkspaceMediator mediator, DAVConnection connection, String path, long revision, boolean isCopy) { myPath = path; myMediator = mediator; String locationPath = SVNEncodingUtil.uriEncode(connection.getLocation().getPath()); myURL = SVNPathUtil.append(locationPath, path); myRevision = revision; myConnection = connection; myIsCopy = isCopy; }
public DAVResource(ISVNWorkspaceMediator mediator, DAVConnection connection, String path, long revision, boolean isCopy) { myPath = path; myMediator = mediator; String locationPath = SVNEncodingUtil.uriEncode(connection.getLocation().getPath()); myURL = SVNPathUtil.append(locationPath, path); myRevision = revision; myConnection = connection; myIsCopy = isCopy; }
@Nullable @Override public RepositoryInfo getRepository(@NotNull SVNURL url) throws SVNException { final Map.Entry<String, GiteaProject> entry = RepositoryListMapping.getMapped(mapping, url.getPath()); if (entry != null && entry.getValue().isReady()) { return new RepositoryInfo( SVNURL.create(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort() == SVNURL.getDefaultPortNumber(url.getProtocol()) ? -1 : url.getPort(), entry.getKey(), true), entry.getValue().getRepository() ); } return null; }
@Nullable @Override public RepositoryInfo getRepository(@NotNull SVNURL url) throws SVNException { final Map.Entry<String, GitLabProject> entry = RepositoryListMapping.getMapped(mapping, url.getPath()); if (entry != null && entry.getValue().isReady()) { return new RepositoryInfo( SVNURL.create(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort() == SVNURL.getDefaultPortNumber(url.getProtocol()) ? -1 : url.getPort(), entry.getKey(), true), entry.getValue().getRepository() ); } return null; }
public static SVNCommitInfo commit(Collection tmpFiles, Map commitItems, SVNURL url, ISVNEditor commitEditor, ISVNEventHandler eventHandler) throws SVNException { String repositoryRoot = url.getPath(); SVNCommitter committer = new SVNCommitter(commitItems, repositoryRoot, tmpFiles); SVNCommitUtil.driveCommitEditor(committer, commitItems.keySet(), commitEditor, -1); committer.sendTextDeltas(commitEditor); SVNEvent event = SVNEventFactory.createSVNEvent(null, SVNNodeKind.UNKNOWN, null, SVNRepository.INVALID_REVISION, SVNEventAction.COMMIT_FINALIZING, SVNEventAction.COMMIT_FINALIZING, null, null); event.setURL(url); if (eventHandler != null) { eventHandler.handleEvent(event, -1); } return commitEditor.closeEdit(); }
/** * Returns a string representing a decoded url. * * @return a decoded url string */ public String toDecodedString() { return composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), getPath()); }
/** * Returns a string representing a decoded url. * * @return a decoded url string */ public String toDecodedString() { return composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), getPath()); }
/** * Returns a string representing a decoded url. * * @return a decoded url string */ public String toDecodedString() { return composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), getPath()); }
@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 long getLatestRevision() throws SVNException { try { openConnection(); String path = getLocation().getPath(); path = SVNEncodingUtil.uriEncode(path); DAVConnection connection = getConnection(); DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, -1, false, true, null); return info.revision; } finally { closeConnection(); } }
public long getLatestRevision() throws SVNException { try { openConnection(); String path = getLocation().getPath(); path = SVNEncodingUtil.uriEncode(path); DAVConnection connection = getConnection(); DAVBaselineInfo info = DAVUtil.getBaselineInfo(connection, this, path, -1, false, true, null); return info.revision; } finally { closeConnection(); } }