當前位置: 首頁>>代碼示例>>Java>>正文


Java SVNURL類代碼示例

本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL類的具體用法?Java SVNURL怎麽用?Java SVNURL使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SVNURL類屬於org.tmatesoft.svn.core包,在下文中一共展示了SVNURL類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: svnDelete

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
private void svnDelete (	BufferedWriter bw, File baseFolder, List<File> filesToDelete, String baseConfigUrl,
							SVNCommitClient svnCommitClient, String comment )
		throws SVNException {
	List<SVNURL> urlsToDelete = new ArrayList<>();

	filesToDelete.forEach( deleteFile -> {
		try {
			String deleteTarget = baseConfigUrl + "/" + deleteFile.getName();
			if ( baseFolder != null ) {
				String newPath = deleteFile.toURI().getPath().substring( baseFolder.toURI().getPath().length() );
				deleteTarget = baseConfigUrl + "/" + newPath;
			}
			logger.info( "url to check: {}", deleteTarget );
			SVNURL url = SVNURL.parseURIEncoded( deleteTarget );
			urlsToDelete.add( url );
			// deleting from fs now.

			updateProgress( bw, "* Deleting from File system: " + deleteFile.getAbsolutePath() );
			FileUtils.deleteQuietly( deleteFile );
		} catch (SVNException ex) {
			logger.error( "Failed to generated svn url for {}", deleteFile.getAbsolutePath(), ex );
		}
	} );

	svnCommitClient.doDelete( urlsToDelete.toArray( new SVNURL[ 0 ] ), comment );
}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:27,代碼來源:SourceControlManager.java

示例2: 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() );
	}
}
 
開發者ID:csap-platform,項目名稱:csap-core,代碼行數:16,代碼來源:SourceControlManager.java

示例3: SvnIntegrateChangesTask

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
public SvnIntegrateChangesTask(final SvnVcs vcs, @NotNull WorkingCopyInfo info, final MergerFactory mergerFactory,
                               final SVNURL currentBranchUrl, final String title, final boolean dryRun, String branchName) {
  super(vcs.getProject(), title, true, VcsConfiguration.getInstance(vcs.getProject()).getUpdateOption());
  myDryRun = dryRun;
  myTitle = title;

  myProjectLevelVcsManager = ProjectLevelVcsManagerEx.getInstanceEx(myProject);
  myVcs = vcs;

  myInfo = info;

  myAccumulatedFiles = new UpdatedFilesReverseSide(UpdatedFiles.create());
  myExceptions = new ArrayList<VcsException>();
  myHandler = new IntegrateEventHandler(myVcs, ProgressManager.getInstance().getProgressIndicator());
  myMerger = mergerFactory.createMerger(myVcs, new File(myInfo.getLocalPath()), myHandler, currentBranchUrl, branchName);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:SvnIntegrateChangesTask.java

示例4: 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");
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:33,代碼來源:SVNDiff.java

示例5: getProxyAuthentication

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
@Nullable
public PasswordAuthentication getProxyAuthentication(@NotNull SVNURL repositoryUrl) {
  Proxy proxy = getIdeaDefinedProxy(repositoryUrl);
  PasswordAuthentication result = null;

  if (proxy != null) {
    if (myProxyCredentialsWereReturned) {
      showFailedAuthenticateProxy();
    }
    else {
      result = getProxyAuthentication(proxy, repositoryUrl);
      myProxyCredentialsWereReturned = result != null;
    }
  }

  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:AuthenticationService.java

示例6: RepoGroup

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
private RepoGroup(ThrowableConvertor<SVNURL, SVNRepository, SVNException> creator, int cached, int concurrent,
                  final ThrowableConsumer<Pair<SVNURL, SVNRepository>, SVNException> adjuster,
                  final ApplicationLevelNumberConnectionsGuard guard, final Object waitObj, final long connectionTimeout) {
  myCreator = creator;
  myMaxCached = cached;
  myMaxConcurrent = concurrent;
  myAdjuster = adjuster;
  myGuard = guard;
  myConnectionTimeout = connectionTimeout;

  myInactive = new TreeMap<Long, SVNRepository>();
  myUsed = new HashSet<SVNRepository>();

  myDisposed = false;
  myWait = waitObj;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:CachingSvnRepositoryPool.java

示例7: getDefaultSSHAuthentication

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
@Override
protected SVNSSHAuthentication getDefaultSSHAuthentication(SVNURL url) {
  String userName = getDefaultUsername(ISVNAuthenticationManager.SSH, url);

  // This is fully copied from base class - DefaultSVNAuthenticationManager - as there are no setters in Authentication classes
  // and there is no url parameter if overriding getDefaultOptions()
  String password = getDefaultOptions().getDefaultSSHPassword();
  String keyFile = getDefaultOptions().getDefaultSSHKeyFile();
  int port = getDefaultOptions().getDefaultSSHPortNumber();
  String passphrase = getDefaultOptions().getDefaultSSHPassphrase();

  if (userName != null && password != null) {
    return new SVNSSHAuthentication(userName, password, port, getHostOptionsProvider().getHostOptions(url).isAuthStorageEnabled(), url,
                                    false);
  }
  else if (userName != null && keyFile != null) {
    return new SVNSSHAuthentication(userName, new File(keyFile), passphrase, port,
                                    getHostOptionsProvider().getHostOptions(url).isAuthStorageEnabled(), url, false);
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:SvnAuthenticationManager.java

示例8: commonScheme

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
private void commonScheme(final SVNURL url, final boolean username, final String realm) throws SVNException {
  String kind = null;

  final String actualRealm = realm == null ? "realm" : realm;
  final String protocol = url.getProtocol();
  if (username) {
    kind = ISVNAuthenticationManager.USERNAME;
  } else if ("svn+ssh".equals(protocol)) {
    kind = ISVNAuthenticationManager.SSH;
  } else if ("http".equals(protocol)) {
    kind = ISVNAuthenticationManager.PASSWORD;
  } else if ("https".equals(protocol)) {
    kind = ISVNAuthenticationManager.SSL;
  } else if ("file".equals(protocol)) {
    kind = ISVNAuthenticationManager.USERNAME;
  }
  SVNAuthentication authentication = null;
  try {
    authentication = myAuthenticationManager.getFirstAuthentication(kind, actualRealm, url);
    while (! passwordSpecified(authentication)) {
      authentication = myAuthenticationManager.getNextAuthentication(kind, actualRealm, url);
    }
  } finally {
    myAuthenticationManager.acknowledgeAuthentication(authentication != null, kind, actualRealm, null, authentication, url);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SvnAuthenticationTest.java

示例9: loadBackwards

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
private void loadBackwards(SVNURL svnurl) throws SVNException, VcsException {
  // this method is called when svnurl does not exist in latest repository revision - thus concrete old revision is used for "info"
  // command to get repository url
  Info info = myVcs.getInfo(svnurl, myPeg, myPeg);
  final SVNURL rootURL = info != null ? info.getRepositoryRootURL() : null;
  final String root = rootURL != null ? rootURL.toString() : "";
  String relativeUrl = myUrl;
  if (myUrl.startsWith(root)) {
    relativeUrl = myUrl.substring(root.length());
  }

  final RepositoryLogEntryHandler repositoryLogEntryHandler =
      new RepositoryLogEntryHandler(myVcs, myUrl, SVNRevision.UNDEFINED, relativeUrl,
                                    new ThrowableConsumer<VcsFileRevision, SVNException>() {
                                      @Override
                                      public void consume(VcsFileRevision revision) throws SVNException {
                                        myConsumer.consume(revision);
                                      }
                                    }, rootURL);
  repositoryLogEntryHandler.setThrowCancelOnMeetPathCreation(true);

  SvnTarget target = SvnTarget.fromURL(rootURL, myFrom);
  myVcs.getFactory(target).createHistoryClient()
    .doLog(target, myFrom, myTo == null ? SVNRevision.create(1) : myTo, false, true, myShowMergeSources && mySupport15, 1, null,
           repositoryLogEntryHandler);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SvnHistoryProvider.java

示例10: getKinds

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
@NotNull
public static List<String> getKinds(final SVNURL url, boolean passwordRequest) {
  if (passwordRequest || "http".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.PASSWORD);
  }
  else if ("https".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.SSL);
  }
  else if ("svn".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.PASSWORD);
  }
  else if (url.getProtocol().contains("svn+")) {  // todo +-
    return Arrays.asList(ISVNAuthenticationManager.SSH, ISVNAuthenticationManager.USERNAME);
  }
  return Collections.singletonList(ISVNAuthenticationManager.USERNAME);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:AuthenticationService.java

示例11: requestClientAuthentication

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
public SVNAuthentication requestClientAuthentication(final String kind, final SVNURL url, final String realm, final SVNErrorMessage errorMessage,
                                                     final SVNAuthentication previousAuth, final boolean authMayBeStored) {
  try {
    return wrapNativeCall(new ThrowableComputable<SVNAuthentication, SVNException>() {
      @Override
      public SVNAuthentication compute() throws SVNException {
        final SVNAuthentication svnAuthentication =
          myDelegate.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
        myListener.getMulticaster().requested(ProviderType.persistent, url, realm, kind, svnAuthentication == null);
        return svnAuthentication;
      }
    });
  }
  catch (SVNException e) {
    LOG.info(e);
    throw new RuntimeException(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:SvnAuthenticationManager.java

示例12: actionPerformed

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
public void actionPerformed(AnActionEvent e) {
  RepositoryTreeNode node = myBrowserComponent.getSelectedNode();
  if (node == null) {
    return;
  }
  SVNURL url = node.getURL();
  if (url != null) {
    int rc = Messages.showYesNoDialog(myBrowserComponent.getProject(), SvnBundle.message("repository.browser.discard.location.prompt", url.toString()),
                                      SvnBundle.message("repository.browser.discard.location.title"), Messages.getQuestionIcon());
    if (rc != Messages.YES) {
      return;
    }
    SvnApplicationSettings.getInstance().removeCheckoutURL(url.toString());
    myBrowserComponent.removeURL(url.toString());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:RepositoryBrowserDialog.java

示例13: reset

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
public void reset(final SvnConfiguration configuration) {
  final UpdateRootInfo rootInfo = configuration.getUpdateRootInfo(myRoot.getIOFile(), myVcs);

  mySourceUrl = rootInfo.getUrl();
  SVNURL branchUrl = getBranchForUrl(mySourceUrl);
  if (branchUrl != null) {
    myBranchField.setText(SVNPathUtil.tail(branchUrl.toDecodedString()));
  }

  myURLText.setText(mySourceUrl != null ? mySourceUrl.toDecodedString() : "");
  myRevisionBox.setSelected(rootInfo.isUpdateToRevision());
  myRevisionText.setText(rootInfo.getRevision().toString());
  myUpdateToSpecificUrl.setSelected(false);
  myRevisionText.setEnabled(myRevisionBox.isSelected());
  myURLText.setEnabled(myUpdateToSpecificUrl.isSelected());
  myBranchField.setEnabled(myUpdateToSpecificUrl.isSelected() && (mySourceUrl != null));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:SvnUpdateRootOptionsPanel.java

示例14: resolveElementUrl

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
@Nullable
protected SVNURL resolveElementUrl() throws SVNException {
  final SvnFileUrlMapping urlMapping = myVcs.getSvnFileUrlMapping();
  final File file = new File(myVirtualFile.getPath());
  final SVNURL fileUrl = urlMapping.getUrlForFile(file);
  if (fileUrl == null) {
    return null;
  }

  final String fileUrlString = fileUrl.toString();
  final RootUrlInfo rootMixed = urlMapping.getWcRootForUrl(fileUrlString);
  if (rootMixed == null) {
    return null;
  }

  final SVNURL thisBranchForUrl = SvnUtil.getBranchForUrl(myVcs, rootMixed.getVirtualFile(), fileUrlString);
  if (thisBranchForUrl == null) {
    return null;
  }

  final String relativePath = SVNPathUtil.getRelativePath(thisBranchForUrl.toString(), fileUrlString);
  return SVNURL.parseURIEncoded(SVNPathUtil.append(myBranchUrl, relativePath));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:ElementWithBranchComparer.java

示例15: openDialog

import org.tmatesoft.svn.core.SVNURL; //導入依賴的package包/類
@Nullable
private static SelectLocationDialog openDialog(Project project,
                                               String url,
                                               String dstLabel,
                                               String dstName,
                                               boolean showFiles,
                                               boolean allowActions,
                                               String errorMessage) {
  try {
    SVNURL svnUrl = SvnUtil.createUrl(url);
    final SVNURL repositoryUrl = initRoot(project, svnUrl);
    if (repositoryUrl == null) {
      Messages.showErrorDialog(project, "Can not detect repository root for URL: " + url,
                               SvnBundle.message("dialog.title.select.repository.location"));
      return null;
    }
    SelectLocationDialog dialog = new SelectLocationDialog(project, repositoryUrl, dstLabel, dstName, showFiles, allowActions);
    dialog.show();
    return dialog;
  }
  catch (SvnBindException e) {
    Messages.showErrorDialog(project, errorMessage != null ? errorMessage : e.getMessage(),
                             SvnBundle.message("dialog.title.select.repository.location"));
    return null;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SelectLocationDialog.java


注:本文中的org.tmatesoft.svn.core.SVNURL類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。