本文整理汇总了Java中org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions类的典型用法代码示例。如果您正苦于以下问题:Java DefaultSVNOptions类的具体用法?Java DefaultSVNOptions怎么用?Java DefaultSVNOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultSVNOptions类属于org.tmatesoft.svn.core.internal.wc包,在下文中一共展示了DefaultSVNOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSVNClientManager
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public static SVNClientManager getSVNClientManager(String userName, String password) throws SVNException {
/*
* Creates a default run-time configuration options driver. Default
* options created in this way use the Subversion run-time configuration
* area (for instance, on a Windows platform it can be found in the
* '%APPDATA%\Subversion' directory).
*
* readonly = true - not to save any configuration changes that can be
* done during the program run to a config file (config settings will
* only be read to initialize; to enable changes the readonly flag
* should be set to false).
*
* SVNWCUtil is a utility class that creates a default options driver.
*/
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
/*
* Creates an instance of SVNClientManager providing authentication
* information (name, password) and an options driver
*/
return SVNClientManager.newInstance(options, userName, password);
}
示例2: getClientManager
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
private synchronized SVNClientManager getClientManager() {
if (clientManager == null) {
final DefaultSVNOptions options = new DefaultSVNOptions(null, true) {
private String[] ignorePatterns;
{
ignorePatterns = new String[] {};
}
@Override
public String[] getIgnorePatterns() {
return ignorePatterns;
}
};
options.setIgnorePatterns(null);
clientManager = SVNClientManager.newInstance(options, authManager);
}
return clientManager;
}
示例3: testeCheckOut
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public void testeCheckOut() throws SVNException {
DefaultSVNOptions myOptions = new DefaultSVNOptions();
SVNClientManager clientManager = SVNClientManager.newInstance(myOptions, "kann", senha_ic);
SVNURL url = SVNURL.parseURIDecoded(SVN_SPRING_SECURITY);
File dir = new File(PASTA_WORKSPACE);
if (dir.exists()) {
if (dir.list() != null) {
throw new RuntimeException("Para Esse Teste O diretório [" + PASTA_WORKSPACE + "] deve estar vazio");
}
} else {
dir.mkdir();
}
clientManager.createRepository(url, true);
clientManager.getUpdateClient().doCheckout(url, dir, SVNRevision.UNDEFINED, SVNRevision.HEAD, true);
//// UPDATE
// clientManager.getUpdateClient().doUpdate(dir, SVNRevision.HEAD, true);
//
//// COMMIT
// clientManager.getCommitClient().doCommit(new File[] {new File(dir, "www")}, false, "message", false, true);
}
示例4: getAdminClient
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public SVNAdminClient getAdminClient() {
if (adminClient == null) {
String authenticationId = svnRepository.getAuthenticationId();
if (!StringUtils.isBlank(authenticationId)) {
}
Server serverSettings = mavenContext
.getServerSettings(authenticationId);
String username = serverSettings.getUsername();
String password = serverSettings.getPassword();
DefaultSVNOptions defaultSVNOptions = new DefaultSVNOptions();
SVNClientManager clientManager = SVNClientManager.newInstance(
defaultSVNOptions, username, password);
adminClient = clientManager.getAdminClient();
}
return adminClient;
}
示例5: init
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的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);
}
}
示例6: getStatus
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
@Nullable
private String getStatus(final File ioFile) throws SVNException {
try {
SVNStatusClient readClient = new SVNStatusClient((ISVNRepositoryPool)null, new DefaultSVNOptions());
final SVNStatus status = readClient.doStatus(ioFile, false);
return status == null ? null : status.getNodeStatus().toString();
} catch (SVNException e) {
if (SVNErrorCode.WC_NOT_WORKING_COPY.equals(e.getErrorMessage().getErrorCode())) {
return null;
}
throw e;
}
}
示例7: apply
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public Map<String, String> apply(final String filename) {
final Map<String, String> result = new LinkedHashMap<String, String>();
final Map<String, String> autoprops = _current;
for (Map.Entry<String, String> entry : autoprops.entrySet()) {
final String pattern = entry.getKey();
final String value = entry.getValue();
if (value != null && !"".equals(value) && DefaultSVNOptions.matches(pattern, filename)) {
for (StringTokenizer tokens = new StringTokenizer(value, ";"); tokens.hasMoreTokens();) {
String token = tokens.nextToken().trim();
int i = token.indexOf('=');
if (i < 0) {
result.put(token, "");
}
else {
String name = token.substring(0, i).trim();
String pValue = i == token.length() - 1 ? "" : token.substring(i + 1).trim();
if (!"".equals(name.trim())) {
if (pValue.startsWith("\"") && pValue.endsWith("\"") && pValue.length() > 1) {
pValue = pValue.substring(1, pValue.length() - 1);
}
result.put(name, pValue);
}
}
}
}
}
return result;
}
示例8: svnCheckout
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
/**
*
* @param destinationPath - Destination Path for checkout
* @return -1 if not authenticated, 1 warning - destination path already exists and is a directory, 2 error destination path exists and is file, 0 success
*/
public int svnCheckout(String destinationPath) {
int flag = 0;
if (username == null || password == null) {
return -1;
}
File fileDestinationPath = new File(destinationPath);
if (fileDestinationPath.exists()) {
if (fileDestinationPath.isFile()) {
return 2;
} else if (fileDestinationPath.isDirectory()) {
flag = 1;
}
}
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager clientManager = SVNClientManager.newInstance(options, this.username, this.password);
SVNUpdateClient updateClient = clientManager.getUpdateClient();
try {
updateClient.doCheckout(projectUrl, fileDestinationPath, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY, true);
} catch (SVNException e) {
System.out.println("Exception ");
e.printStackTrace();
}
System.out.println("Checkout finished successfully !");
return flag;
}
示例9: action
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
@Override
public void action(SVNInfo info) {
final String us = info.getUsername();
final String pw = info.getPassword();
try {
// create a SVN client manager instance
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager cm = newInstance(options, us, pw);
// create a SVNLogClient instance
SVNLogClient client = cm.getLogClient();
// list the SVN entries
ISVNDirEntryHandler handler = new MuteSVNDirEntryHandler();
SVNURL svnUrl = SVNURL.parseURIEncoded(info.getUrl());
while (!svnUrl.getPath().endsWith(info.getProjectName())) {
svnUrl = svnUrl.removePathTail();
}
svnUrl = svnUrl.appendPath(getSvnFolder(), true);
client.doList(svnUrl, HEAD, HEAD, false, SVNDepth.UNKNOWN,
SVNDirEntry.DIRENT_TIME, handler);
} catch (SVNException e) {
throw new InvalidUserDataException(e);
}
}
示例10: action
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void action(SVNInfo info) {
final String us = info.getUsername();
final String pw = info.getPassword();
// create a SVN client manager instance
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager cm = newInstance(options, us, pw);
// create a SVN copy client instance
SVNCopyClient copy = cm.getCopyClient();
try {
// parse the SVN source URL
SVNURL svnUrl = SVNURL.parseURIEncoded(info.getUrl());
// parse the SVN destination URL
SVNURL url = getSvnUrl(info);
// prepare the copy source
SVNRevision rev = info.getRevision();
SVNCopySource[] sources = { new SVNCopySource(rev, null, svnUrl) };
// create the tag
if (!info.isSimulateRun()) {
copy.doCopy(sources, url, false, false, false, getComment(),
null);
} else {
info.getLogger().info("simulate copy SVN folder " + svnUrl);
}
} catch (SVNException e) {
throw new InvalidUserDataException("error while copying SVN folder", e);
}
}
示例11: SvnMergeInfoCache
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
private SvnMergeInfoCache(final Project project) {
myProject = project;
myState = new MyState();
final SvnVcs vcs = SvnVcs.getInstance(myProject);
myClient = vcs.createWCClient();
myClient.setOptions(new DefaultSVNOptions() {
@Override
public byte[] getNativeEOL() {
return new byte[]{'\n'};
}
});
}
示例12: createOperationFactory
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
@NotNull
private SvnOperationFactory createOperationFactory(@NotNull String userName, @NotNull String password) {
final SVNWCContext wcContext = new SVNWCContext(new DefaultSVNOptions(getTempDirectory(), true), null);
wcContext.setSqliteTemporaryDbInMemory(true);
wcContext.setSqliteJournalMode(SqlJetPagerJournalMode.MEMORY);
final SvnOperationFactory factory = new SvnOperationFactory(wcContext);
factory.setAuthenticationManager(BasicAuthenticationManager.newInstance(userName, password.toCharArray()));
svnFactories.add(factory);
return factory;
}
示例13: checkOutFromSvn
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public static String checkOutFromSvn(String tableId,String project, String modelName) {
//获取SVN驱动选项
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
// 实例化客户端管理类
SVNClientManager ourClientManager = SVNClientManager.newInstance((DefaultSVNOptions) options, USERNAME, PASSWORD);
SVNURL repositoryURL = null;
// 需要循环seg_*
try {
// 通过客户端管理类获得updateClient类的实例。
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
int is_h=0;
for (int i = 0; i < 100; i++) {
String seg="seg_"+i;
String url=URL_ROOT + modelM.get("DataFlow") + "/table/";
url+=seg;
String filepath = PATH + seg;
del(filepath);
repositoryURL = SVNURL.parseURIEncoded(url);
boolean b = isURLExist(repositoryURL, "zhangkai05", "zhangkai05");
if(b) {
is_h++;
updateClient.setIgnoreExternals(true);
// 执行check out 操作,返回工作副本的版本号。
long workingVersion = updateClient.doCheckout(repositoryURL, new File(filepath),SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY,false);
//System.out.println(workingVersion + "版本获得成功!");
}
}
//is_h
String file_path = getFile(tableId, PATH, is_h);
return file_path;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
示例14: returnChangedDirectories
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public List<String> returnChangedDirectories() {
if (getRepository() == null) {
return null;
}
if (getVersion() == null) {
return null;
}
File repositoryDir = new File(getRepository());
changedDirectories svnChangedDirectories = new changedDirectories();
ISVNAuthenticationManager svnManager = new BasicAuthenticationManager(loginSVN, senhaSVN);
ISVNOptions svnOptions = new DefaultSVNOptions();
SVNLookClient cliLook = new SVNLookClient(svnManager, svnOptions);
try {
cliLook.doGetChangedDirectories(repositoryDir, SVNRevision.create(Long.parseLong(getVersion())), svnChangedDirectories);
} catch (SVNException ex) {
Logger.getLogger(SvnInformation.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
return svnChangedDirectories.getDirectories();
}
示例15: retornaMensagem
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; //导入依赖的package包/类
public String retornaMensagem(){
String result = null;
if (getRepository() == null) {
return null;
}
if (getVersion() == null) {
return null;
}
ISVNAuthenticationManager svnManager = new BasicAuthenticationManager("", "");
ISVNOptions svnOptions = new DefaultSVNOptions();
SVNLookClient cliLook = new SVNLookClient(svnManager, svnOptions);
File rep = new File(getRepository());
try {
result = cliLook.doGetLog(rep, SVNRevision.create(Long.parseLong(getVersion())));
} catch (SVNException ex) {
System.out.println("Problema ao fazer svnlook log");
Logger.getLogger(SvnInformation.class.getName()).log(Level.SEVERE, null, ex);
}
return result;
}