本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.parseURIEncoded方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.parseURIEncoded方法的具體用法?Java SVNURL.parseURIEncoded怎麽用?Java SVNURL.parseURIEncoded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.tmatesoft.svn.core.SVNURL
的用法示例。
在下文中一共展示了SVNURL.parseURIEncoded方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addToSvnIfNotThere
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public void addToSvnIfNotThere ( File applicationFolder, File newOrUpdatedItem, String targetUrlFolder, SVNCommitClient svnCommitClient,
String comment ) {
try {
logger.info( "Checking for new file: {}", newOrUpdatedItem.getAbsolutePath() );
// stripping off the parent path
String newPath = newOrUpdatedItem.toURI().getPath().substring( applicationFolder.toURI().getPath().length() );
SVNURL url = SVNURL.parseURIEncoded( targetUrlFolder + "/" + newPath );
logger.info( "url to check: {}", url );
svnCommitClient.doImport( newOrUpdatedItem, url, "Agent adding proprs file: " + comment, null, true, true, SVNDepth.INFINITY );
} catch (Exception e) {
logger.info( "File already present: {}, \n svn response: \n {}", newOrUpdatedItem.getAbsolutePath(), e.getMessage() );
}
}
示例2: 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");
}
示例3: serializeUrl
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private static String serializeUrl(final String url, final Ref<Boolean> withUserInfo) {
if (Boolean.FALSE.equals(withUserInfo.get())) {
return url;
}
try {
final SVNURL svnurl = SVNURL.parseURIEncoded(url);
if (withUserInfo.isNull()) {
final String userInfo = svnurl.getUserInfo();
withUserInfo.set((userInfo != null) && (userInfo.length() > 0));
}
if (withUserInfo.get()) {
return SVNURL.create(svnurl.getProtocol(), null, svnurl.getHost(), SvnUtil.resolvePort(svnurl), svnurl.getURIEncodedPath(), true)
.toString();
}
}
catch (SVNException e) {
//
}
return url;
}
示例4: init
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
/**
* 접속정보 초기화
*
* @작성자 : KYJ
* @작성일 : 2016. 5. 2.
* @param properties
*/
public void init(Properties properties) {
validate();
try {
svnURL = SVNURL.parseURIEncoded(getUrl());
repository = SVNRepositoryFactory.create(svnURL);
if ((getUserId() == null && getUserPassword() == null) || (getUserId().isEmpty() && getUserPassword().isEmpty())) {
authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.getDefaultConfigurationDirectory());
} else {
authManager = SVNWCUtil.createDefaultAuthenticationManager(getUserId(), getUserPassword().toCharArray());
}
repository.setAuthenticationManager(authManager);
DefaultSVNOptions options = new DefaultSVNOptions();
svnManager = SVNClientManager.newInstance(options, authManager);
// svnManager.dispose();
// repository.closeSession();
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
// throw new RuntimeException(e);
}
}
示例5: characters
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@Override
public void characters(String s, SvnInfoStructure structure) throws SAXException {
try {
structure.myUrl = SVNURL.parseURIEncoded(s);
}
catch (SVNException e) {
throw new SAXException(e);
}
}
示例6: parseUrl
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public static SVNURL parseUrl(@NotNull String url) {
try {
return SVNURL.parseURIEncoded(url);
}
catch (SVNException e) {
throw createIllegalArgument(e);
}
}
示例7: loadBranches
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@NotNull
public List<SvnBranchItem> loadBranches() throws SVNException, VcsException {
SvnVcs vcs = SvnVcs.getInstance(myProject);
SVNURL branchesUrl = SVNURL.parseURIEncoded(myUrl);
List<SvnBranchItem> result = new LinkedList<SvnBranchItem>();
SvnTarget target = SvnTarget.fromURL(branchesUrl);
DirectoryEntryConsumer handler = createConsumer(result);
vcs.getFactory(target).create(BrowseClient.class, !myPassive).list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
Collections.sort(result);
return result;
}
示例8: accept
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public boolean accept(final String url) throws SVNException {
if (myRootUrl != null) {
final File baseDir = new File(myRoot.getPath());
final String baseUrl = myRootUrl.getPath();
final SVNURL branchUrl = SVNURL.parseURIEncoded(url);
if (myRootUrl.equals(SVNURLUtil.getCommonURLAncestor(myRootUrl, branchUrl))) {
final File file = SvnUtil.fileFromUrl(baseDir, baseUrl, branchUrl.getPath());
myBranchesUnder.put(url, file.getAbsolutePath());
}
}
return false; // iterate everything
}
示例9: getURL
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public SVNURL getURL() {
if (getOKAction().isEnabled()) {
try {
return SVNURL.parseURIEncoded(myURLLabel.getText());
}
catch (SVNException ignore) {
}
}
return null;
}
示例10: patchChange
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private void patchChange(Change change, final String path) {
final SVNURL becameUrl;
SVNURL wasUrl;
try {
becameUrl = SVNURL.parseURIEncoded(SVNPathUtil.append(myRepositoryRoot, path));
wasUrl = becameUrl;
if (change instanceof ExternallyRenamedChange && change.getBeforeRevision() != null) {
String originUrl = ((ExternallyRenamedChange)change).getOriginUrl();
if (originUrl != null) {
// use another url for origin
wasUrl = SVNURL.parseURIEncoded(SVNPathUtil.append(myRepositoryRoot, originUrl));
}
}
}
catch (SVNException e) {
// nothing to do
LOG.info(e);
return;
}
final FilePath filePath = ChangesUtil.getFilePath(change);
final Change additional = new Change(createPropertyRevision(filePath, change.getBeforeRevision(), wasUrl),
createPropertyRevision(filePath, change.getAfterRevision(), becameUrl));
change.addAdditionalLayerElement(SvnChangeProvider.PROPERTY_LAYER, additional);
}
示例11: setUp
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@Override
public void setUp() throws Exception {
super.setUp();
myTrunkUrl = myRepoUrl + "/trunk";
myBranchUrl = myRepoUrl + "/branch";
myBranchVcsRoot = new File(myTempDirFixture.getTempDirPath(), "branch");
myBranchVcsRoot.mkdir();
myProjectLevelVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
myProjectLevelVcsManager.setDirectoryMapping(myBranchVcsRoot.getAbsolutePath(), SvnVcs.VCS_NAME);
VirtualFile vcsRoot = LocalFileSystem.getInstance().findFileByIoFile(myBranchVcsRoot);
Node node = new Node(vcsRoot, SVNURL.parseURIEncoded(myBranchUrl), SVNURL.parseURIEncoded(myRepoUrl));
RootUrlInfo root = new RootUrlInfo(node, WorkingCopyFormat.ONE_DOT_SIX, vcsRoot, null);
myWCInfo = new WCInfo(root, true, Depth.INFINITY);
myMergeContext = new MergeContext(SvnVcs.getInstance(myProject), myTrunkUrl, myWCInfo, SVNPathUtil.tail(myTrunkUrl), vcsRoot);
myOneShotMergeInfoHelper = new OneShotMergeInfoHelper(myMergeContext);
myVcs = SvnVcs.getInstance(myProject);
myVcs.getSvnConfiguration().setCheckNestedForQuickMerge(true);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final String repoUrl = SVNURL.parseURIDecoded(myRepoUrl).toString();
myWCInfoWithBranches = new WCInfoWithBranches(myWCInfo, Collections.<WCInfoWithBranches.Branch>emptyList(), vcsRoot,
new WCInfoWithBranches.Branch(repoUrl + "/trunk"));
myMergeChecker = new BranchInfo(myVcs, myWCInfoWithBranches, new WCInfoWithBranches.Branch(repoUrl + "/branch"));
}
示例12: commitShibboleth2ConfigurationFiles
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public boolean commitShibboleth2ConfigurationFiles(GluuOrganization organization, List<SubversionFile> newSubversionFiles,
List<SubversionFile> removeSubversionFiles, String svnComment) {
// Retrieve properties and derive applianceSvnHome
String svnUrl = applicationConfiguration.getSvnConfigurationStoreRoot();
String inumFN = StringHelper.removePunctuation(applicationConfiguration.getApplianceInum());
String svnPassword = applicationConfiguration.getSvnConfigurationStorePassword();
String applianceSvnHomePath = String.format("%s/%s", baseSvnDir, inumFN);
if (StringHelper.isEmpty(svnUrl) || StringHelper.isEmpty(inumFN) || StringHelper.isEmpty(svnPassword)) {
// log.error("Failed to commit files to repository. Please check SVN related properties in gluuAppliance.properties file");
return false;
}
SVNClientManager clientManager = null;
try {
// Decrypt password
svnPassword = StringEncrypter.defaultInstance().decrypt(svnPassword, cryptoConfigurationSalt);
// Create an instance of SVNClientManager
log.debug("Creating an instance of SVNClientManager");
SVNURL repositoryURL = SVNURL.parseURIEncoded(svnUrl);
clientManager = SvnHelper.getSVNClientManager(inumFN, svnPassword);
// Check root path exists
boolean result = checkRootSvnPath(clientManager, repositoryURL);
if (!result) {
return result;
}
File applianceSvnHome = new File(applianceSvnHomePath);
removeFilesFromLocalRepository(applianceSvnHome, removeSubversionFiles);
// Copy files to temporary repository folder
copyFilesToLocalRepository(applianceSvnHome, newSubversionFiles);
// Add files
log.debug("Adding files if neccessary");
SvnHelper.addNewFiles(clientManager, applianceSvnHome);
// Commit updates to repository
log.debug("Commiting updates to repository");
String message = String.format("Automatic update of Shibboleth configuration files for organization %s",
organization.getDisplayName());
message += "\n Changes List:\n" + svnComment;
SvnHelper.commit(clientManager, applianceSvnHome, false, message);
return true;
} catch (Exception ex) {
// log.error("Failed to commit files to repository", ex);
} finally {
if (clientManager != null) {
clientManager.dispose();
}
}
return false;
}
示例13: testSavedAndReadUnix
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public void testSavedAndReadUnix() throws Exception {
if (SystemInfo.isWindows) return;
final TestListener listener = new TestListener(mySynchObject);
myAuthenticationManager.addListener(listener);
final SavedOnceListener savedOnceListener = new SavedOnceListener();
myAuthenticationManager.addListener(savedOnceListener);
final SVNURL url = SVNURL.parseURIEncoded("http://some.host.com/repo");
final SVNException[] exception = new SVNException[1];
final Boolean[] result = new Boolean[1];
final File servers = new File(myConfiguration.getConfigurationDirectory(), "servers");
final File oldServers = new File(myConfiguration.getConfigurationDirectory(), "config_old");
FileUtil.copy(servers, oldServers);
try {
FileUtil.appendToFile(servers, "\nstore-plaintext-passwords=yes\n");
synchronousBackground(new Runnable() {
@Override
public void run() {
try {
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.interactive, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.save));
commonScheme(url, false, null);
Assert.assertEquals(3, listener.getCnt());
//long start = System.currentTimeMillis();
//waitListenerStep(start, listener, 3);
SvnConfiguration.RUNTIME_AUTH_CACHE.clear();
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.request));
commonScheme(url, false, null);
//start = System.currentTimeMillis();
//waitListenerStep(start, listener, 4);
Assert.assertEquals(4, listener.getCnt());
}
catch (SVNException e) {
exception[0] = e;
}
result[0] = true;
}
});
} finally {
FileUtil.delete(servers);
FileUtil.rename(oldServers, servers);
}
Assert.assertTrue(result[0]);
myTestInteraction.assertNothing();
Assert.assertEquals(4, listener.getCnt());
listener.assertForAwt();
savedOnceListener.assertForAwt();
savedOnceListener.assertSaved(url, ISVNAuthenticationManager.PASSWORD);
if (exception[0] != null) {
throw exception[0];
}
}
示例14: testWhenAuthCredsNoInServers
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public void testWhenAuthCredsNoInServers() throws Exception {
final TestListener listener = new TestListener(mySynchObject);
myAuthenticationManager.addListener(listener);
final SavedOnceListener savedOnceListener = new SavedOnceListener();
myAuthenticationManager.addListener(savedOnceListener);
final File servers = new File(myConfiguration.getConfigurationDirectory(), "servers");
final File oldServers = new File(myConfiguration.getConfigurationDirectory(), "config_old");
FileUtil.copy(servers, oldServers);
try {
FileUtil.appendToFile(servers, "\nstore-auth-creds=no\n");
final SVNURL url = SVNURL.parseURIEncoded("http://some.host.com/repo");
final SVNException[] exception = new SVNException[1];
final Boolean[] result = new Boolean[1];
synchronousBackground(() -> {
try {
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<>(ProviderType.interactive, url, Type.request));
commonScheme(url, false, null);
Assert.assertEquals(2, listener.getCnt());
Assert.assertEquals(1, myTestInteraction.getNumAuthWarn());
myTestInteraction.reset();
savedOnceListener.assertForAwt();
savedOnceListener.reset();
SvnConfiguration.RUNTIME_AUTH_CACHE.clear();
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<>(ProviderType.interactive, url, Type.request));
commonScheme(url, false, null);
Assert.assertEquals(4, listener.getCnt());
Assert.assertEquals(1, myTestInteraction.getNumAuthWarn());
}
catch (SVNException e) {
exception[0] = e;
}
result[0] = true;
});
Assert.assertTrue(result[0]);
Assert.assertEquals(1, myTestInteraction.getNumAuthWarn());
Assert.assertEquals(4, listener.getCnt());
listener.assertForAwt();
savedOnceListener.assertForAwt();
savedOnceListener.assertNotSaved(url, ISVNAuthenticationManager.PASSWORD);
if (exception[0] != null) {
throw exception[0];
}
} finally {
FileUtil.delete(servers);
FileUtil.rename(oldServers, servers);
}
}
示例15: testWhenPassSaveNoInServers
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public void testWhenPassSaveNoInServers() throws Exception {
final TestListener listener = new TestListener(mySynchObject);
myAuthenticationManager.addListener(listener);
final SavedOnceListener savedOnceListener = new SavedOnceListener();
myAuthenticationManager.addListener(savedOnceListener);
final File servers = new File(myConfiguration.getConfigurationDirectory(), "servers");
final File oldServers = new File(myConfiguration.getConfigurationDirectory(), "config_old");
FileUtil.copy(servers, oldServers);
try {
FileUtil.appendToFile(servers, "\nstore-passwords=no\n");
final SVNURL url = SVNURL.parseURIEncoded("http://some.host.com/repo");
final SVNException[] exception = new SVNException[1];
final Boolean[] result = new Boolean[1];
synchronousBackground(new Runnable() {
@Override
public void run() {
try {
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.interactive, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.without_pasword_save));
commonScheme(url, false, null);
Assert.assertEquals(3, listener.getCnt());
Assert.assertEquals(1, myTestInteraction.getNumPasswordsWarn());
myTestInteraction.reset();
savedOnceListener.assertForAwt();
savedOnceListener.reset();
SvnConfiguration.RUNTIME_AUTH_CACHE.clear();
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.interactive, url, Type.request));
listener.addStep(new Trinity<ProviderType, SVNURL, Type>(ProviderType.persistent, url, Type.without_pasword_save));
commonScheme(url, false, null);
Assert.assertEquals(6, listener.getCnt());
Assert.assertEquals(1, myTestInteraction.getNumPasswordsWarn());
}
catch (SVNException e) {
exception[0] = e;
}
result[0] = true;
}
});
Assert.assertTrue(result[0]);
Assert.assertEquals(1, myTestInteraction.getNumPasswordsWarn());
Assert.assertEquals(6, listener.getCnt());
listener.assertForAwt();
savedOnceListener.assertForAwt();
savedOnceListener.assertSaved(url, ISVNAuthenticationManager.PASSWORD);
if (exception[0] != null) {
throw exception[0];
}
} finally {
FileUtil.delete(servers);
FileUtil.rename(oldServers, servers);
}
}