本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.toDecodedString方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.toDecodedString方法的具體用法?Java SVNURL.toDecodedString怎麽用?Java SVNURL.toDecodedString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.tmatesoft.svn.core.SVNURL
的用法示例。
在下文中一共展示了SVNURL.toDecodedString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: diff
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
/********************************
* 작성일 : 2016. 5. 5. 작성자 : KYJ
*
*
* @param path1
* @param rivision1
* @param path2
* @param rivision2
* @return
* @throws SVNException
* @throws UnsupportedEncodingException
********************************/
public String diff(String path1, SVNRevision rivision1, String path2, SVNRevision rivision2) throws SVNException, Exception {
SVNDiffClient diffClient = getSvnManager().getDiffClient();
// StringOutputStream result = new StringOutputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
// SVNURL svnURL = getSvnURL();
// String repositoryPath = getRepository().getRepositoryPath(path1);
SVNURL location = getRepository().getLocation();
String decodedString = location.toDecodedString();
String uriEncodedPath = location.getURIEncodedPath();
String rootUrl = decodedString.replaceAll(uriEncodedPath, "");
SVNURL svnUrl1 = SVNURL.parseURIEncoded(rootUrl + "/" + path1/*getRepository().getRepositoryPath(path1)*/);
SVNURL svnUrl2 = SVNURL.parseURIEncoded(rootUrl + "/" + path2/*getRepository().getRepositoryPath(path2)*/);
diffClient.doDiff(svnUrl1, rivision1, svnUrl2, rivision2, SVNDepth.UNKNOWN, true, out);
return out.toString("UTF-8");
}
示例2: requestCredentials
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@Nullable
public SVNAuthentication requestCredentials(final SVNURL repositoryUrl, final String type) {
SVNAuthentication authentication = null;
if (repositoryUrl != null) {
final String realm = repositoryUrl.toDecodedString();
authentication = requestCredentials(realm, type, new Getter<SVNAuthentication>() {
@Override
public SVNAuthentication get() {
return myVcs.getSvnConfiguration().getInteractiveManager(myVcs).getInnerProvider()
.requestClientAuthentication(type, repositoryUrl, realm, null, null, true);
}
});
}
if (authentication == null) {
LOG.warn("Could not get authentication. Type - " + type + ", Url - " + repositoryUrl);
}
return authentication;
}
示例3: acceptCertificate
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
public AcceptResult acceptCertificate(@NotNull final SVNURL url, @NotNull final String certificateInfo) {
// TODO: Probably explicitly construct server url for realm here - like in CertificateTrustManager.
String kind = "terminal.ssl.server";
String realm = url.toDecodedString();
Object data = SvnConfiguration.RUNTIME_AUTH_CACHE.getDataWithLowerCheck(kind, realm);
AcceptResult result;
if (data != null) {
result = (AcceptResult)data;
}
else {
result =
AcceptResult.from(getAuthenticationManager().getInnerProvider().acceptServerAuthentication(url, realm, certificateInfo, true));
if (!AcceptResult.REJECTED.equals(result)) {
myVcs.getSvnConfiguration().acknowledge(kind, realm, result);
}
}
return result;
}
示例4: getRootUrl
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
/**
* SVN Root Url
*
* @작성자 : KYJ
* @작성일 : 2016. 7. 21.
* @return
*/
public String getRootUrl() {
SVNURL location = getRepository().getLocation();
String decodedString = location.toDecodedString();
String uriEncodedPath = location.getURIEncodedPath();
String rootUrl = decodedString.replaceAll(uriEncodedPath, "");
return decodedString;
}
示例5: acceptServerAuthentication
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public int acceptServerAuthentication(final SVNURL url, String realm, final Object certificate, final boolean resultMayBeStored) {
final int[] result = new int[1];
Runnable command;
if (certificate instanceof X509Certificate || certificate instanceof String) {
command = new Runnable() {
public void run() {
ServerSSLDialog dialog = certificate instanceof X509Certificate
? new ServerSSLDialog(myProject, (X509Certificate)certificate, resultMayBeStored)
: new ServerSSLDialog(myProject, (String)certificate, resultMayBeStored);
dialog.show();
result[0] = dialog.getResult();
}
};
} else if (certificate instanceof byte[]) {
final String sshKeyAlgorithm = myManager.getSSHKeyAlgorithm();
command = new Runnable() {
@Override
public void run() {
final ServerSSHDialog serverSSHDialog =
new ServerSSHDialog(myProject, resultMayBeStored, url.toDecodedString(), sshKeyAlgorithm, (byte[])certificate);
serverSSHDialog.show();
result[0] = serverSSHDialog.getResult();
}
};
} else {
VcsBalloonProblemNotifier.showOverChangesView(myProject, "Subversion: unknown certificate type from " + url.toDecodedString(),
MessageType.ERROR);
return REJECTED;
}
showAndWait(command);
return result[0];
}
示例6: getRepositoryRoot
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
private String getRepositoryRoot(@NotNull SvnRepositoryLocation svnLocation) throws VcsException {
// TODO: Additionally SvnRepositoryLocation could possibly be refactored to always contain FilePath (or similar local item)
// TODO: So here we could get repository url without performing remote svn command
SVNURL rootUrl = SvnUtil.getRepositoryRoot(myVcs, svnLocation.toSvnUrl());
if (rootUrl == null) {
throw new SvnBindException("Could not resolve repository root url for " + svnLocation);
}
return rootUrl.toDecodedString();
}
示例7: processCopiedFile
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private void processCopiedFile(@NotNull SvnChangedFile copiedFile,
@NotNull SvnChangeProviderContext context,
@Nullable VcsDirtyScope dirtyScope) throws SVNException {
boolean foundRename = false;
final Status copiedStatus = copiedFile.getStatus();
final String copyFromURL = copiedFile.getCopyFromURL();
final Set<SvnChangedFile> deletedToDelete = new HashSet<SvnChangedFile>();
for (SvnChangedFile deletedFile : context.getDeletedFiles()) {
final Status deletedStatus = deletedFile.getStatus();
if (deletedStatus.getURL() != null && Comparing.equal(copyFromURL, deletedStatus.getURL().toString())) {
final String clName = SvnUtil.getChangelistName(copiedFile.getStatus());
applyMovedChange(context, copiedFile.getFilePath(), dirtyScope, deletedToDelete, deletedFile, copiedStatus, clName);
for (SvnChangedFile deletedChild : context.getDeletedFiles()) {
final Status childStatus = deletedChild.getStatus();
final SVNURL childUrl = childStatus.getURL();
if (childUrl == null) {
continue;
}
final String childURL = childUrl.toDecodedString();
if (StringUtil.startsWithConcatenation(childURL, copyFromURL, "/")) {
String relativePath = childURL.substring(copyFromURL.length());
File newPath = new File(copiedFile.getFilePath().getIOFile(), relativePath);
FilePath newFilePath = myFactory.createFilePathOn(newPath);
if (!context.isDeleted(newFilePath)) {
applyMovedChange(context, newFilePath, dirtyScope, deletedToDelete, deletedChild, context.getTreeConflictStatus(newPath),
clName);
}
}
}
foundRename = true;
break;
}
}
final List<SvnChangedFile> deletedFiles = context.getDeletedFiles();
for (SvnChangedFile file : deletedToDelete) {
deletedFiles.remove(file);
}
// handle the case when the deleted file wasn't included in the dirty scope - try searching for the local copy
// by building a relative url
if (!foundRename && copiedStatus.getURL() != null) {
File wcPath = guessWorkingCopyPath(copiedStatus.getFile(), copiedStatus.getURL(), copyFromURL);
Status status;
try {
status = myVcs.getFactory(wcPath).createStatusClient().doStatus(wcPath, false);
}
catch(SvnBindException ex) {
LOG.info(ex);
status = null;
}
if (status != null && status.is(StatusType.STATUS_DELETED)) {
final FilePath filePath = myFactory.createFilePathOnDeleted(wcPath, false);
final SvnContentRevision beforeRevision = SvnContentRevision.createBaseRevision(myVcs, filePath, status.getRevision());
final ContentRevision afterRevision = CurrentContentRevision.create(copiedFile.getFilePath());
context.getBuilder().processChangeInList(context.createMovedChange(beforeRevision, afterRevision, copiedStatus, status),
SvnUtil.getChangelistName(status), SvnVcs.getKey());
foundRename = true;
}
}
if (!foundRename) {
// for debug
LOG.info("Rename not found for " + copiedFile.getFilePath().getPresentableUrl());
context.processStatus(copiedFile.getFilePath(), copiedStatus);
}
}