当前位置: 首页>>代码示例>>Java>>正文


Java SVNRepository.checkPath方法代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.io.SVNRepository.checkPath方法的典型用法代码示例。如果您正苦于以下问题:Java SVNRepository.checkPath方法的具体用法?Java SVNRepository.checkPath怎么用?Java SVNRepository.checkPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tmatesoft.svn.core.io.SVNRepository的用法示例。


在下文中一共展示了SVNRepository.checkPath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCopy

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public long getCopy(String relativePath, long revision, SVNProperties properties, OutputStream contents) throws SVNException {

		// URL 검증
		if (relativePath.isEmpty() || relativePath.endsWith("/"))
			throw new SVNException(SVNErrorMessage.create(SVNErrorCode.BAD_URL, "Invalide relativePath : " + relativePath));

		SVNRepository repository = getRepository();

		LOGGER.debug("getCopy : {} ", relativePath);
		SVNNodeKind checkPath = repository.checkPath(relativePath, revision);
		long result = -1;
		if (checkPath == SVNNodeKind.FILE) {
			// return the revision the file has been taken at
			result = repository.getFile(relativePath, revision, properties, contents);

			int lastIndexOf = ValueUtil.lastIndexOf(relativePath, '/');
			String fileName = relativePath.substring(lastIndexOf) + 1;

			LOGGER.debug(fileName);
		}

		return result;
	}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:24,代码来源:SVNCheckout.java

示例2: resolveResource

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
/**
 * Fetch the needed file information for a given file (size, last modification time) and report it back in a
 * SvnResource.
 * 
 * @param repositorySource Full path to resource in subversion (including host, protocol etc.)
 * @return SvnResource filled with the needed informations
 */
protected SvnResource resolveResource(String repositorySource) {
  Message.debug("Resolving resource for " + repositorySource + " [revision=" + svnRetrieveRevision + "]");
  SvnResource result = null;
  try {
    SVNURL url = SVNURL.parseURIEncoded(repositorySource);
    SVNRepository repository = getRepository(url, true);
    SVNNodeKind nodeKind = repository.checkPath("", svnRetrieveRevision);
    if (nodeKind == SVNNodeKind.NONE) {
      // log this on debug, NOT error, see http://code.google.com/p/ivysvn/issues/detail?id=21
      Message.debug("No resource found at " + repositorySource + ", returning default resource");
      result = new SvnResource();
    } else {
      Message.debug("Resource found at " + repositorySource + ", returning resolved resource");
      SVNDirEntry entry = repository.info("", svnRetrieveRevision);
      result = new SvnResource(this, repositorySource, true, entry.getDate().getTime(), entry.getSize());
    }
  } catch (SVNException e) {
    Message.error("Error resolving resource " + repositorySource + ", " + e.getMessage());
    Message.debug("Exception is: " + getStackTrace(e)); // useful for debugging network issues
    result = new SvnResource();
  }
  return result;
}
 
开发者ID:massdosage,项目名称:ivysvn,代码行数:31,代码来源:SvnRepository.java

示例3: readFile

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
@Override
@Nonnull
public InputStream readFile(@Nonnull String path) throws IOException {
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	SVNRepository repository = svnProvider.getRepository();
	try {
		long useRevision = revision;
		if (findLast && repository.checkPath(path, revision) == SVNNodeKind.NONE) {
			useRevision = getLastRevision(repository, path);
		}
		repository.getFile(path, useRevision, new SVNProperties(), out);
	} catch (SVNException e) {
		throw new IOException("failed to read file: " + getFullPath(path), e);
	} finally {
		svnProvider.releaseRepository(repository);
	}
	return new ByteArrayInputStream(out.toByteArray());
}
 
开发者ID:lithiumtech,项目名称:flow,代码行数:19,代码来源:SvnFiler.java

示例4: getExistingParent

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
@Nullable
private SVNURL getExistingParent(final SVNURL url, final SVNRepository repository, final int repoRootLen) throws SVNException {
  final String urlString = url.toString().substring(repoRootLen);
  if (urlString.length() == 0) {
    // === repository url
    return url;
  }
  final SVNNodeKind kind = repository.checkPath(urlString, myEndNumber);
  if (SVNNodeKind.DIR.equals(kind) || SVNNodeKind.FILE.equals(kind)) {
    return url;
  }
  final SVNURL parentUrl = url.removePathTail();
  if (parentUrl == null) {
    return null;
  }
  return getExistingParent(parentUrl, repository, repoRootLen);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:LatestExistentSearcher.java

示例5: checkoutTest

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public void checkoutTest() throws SVNException {
    String checkoutPath = "svn://localhost";
    String username = "integration";
    String password = "integration";
    String checkoutRootPath = new File("/home/jeremie/Developpement/checkoutsvn").getAbsolutePath();

    DAVRepositoryFactory.setup();

    final SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(checkoutPath));
    repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager(username, password));

    final SVNClientManager clientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager());
    final SVNUpdateClient updateClient = clientManager.getUpdateClient();

    updateClient.setIgnoreExternals(false);

    final SVNNodeKind nodeKind = repository.checkPath("", -1);

    if (nodeKind == SVNNodeKind.NONE) {
        System.err.println("There is no entry at '" + checkoutPath + "'.");
        System.exit(1);
    } else if (nodeKind == SVNNodeKind.FILE) {
        System.err.println("The entry at '" + checkoutPath + "' is a file while a directory was expected.");
        System.exit(1);
    }
    System.out.println("*** CHECKOUT SVN Trunk/Branches ***");
    System.out.println("Checkout source: " + checkoutPath);
    System.out.println("Checkout destination: " + checkoutRootPath);
    System.out.println("...");
    try {
        traverse(updateClient, repository, checkoutPath, checkoutRootPath, "", true);
    } catch (final Exception e) {
        System.err.println("ERROR : " + e.getMessage());
        e.printStackTrace(System.err);
        System.exit(-1);
    }
    System.out.println("");
    System.out.println("Repository latest revision: " + repository.getLatestRevision());
}
 
开发者ID:klask-io,项目名称:klask-io,代码行数:40,代码来源:TestCheckOut.java

示例6: verifySVNLocation

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static void verifySVNLocation(SVNRepository repository, String url)
		throws SVNException {
	SVNNodeKind nodeKind = repository.checkPath("", -1);
	if (nodeKind == SVNNodeKind.NONE) {
		System.err.println("There is no entry at '" + url + "'.");
	} else if (nodeKind == SVNNodeKind.FILE) {
		System.err.println("The entry at '" + url
				+ "' is a file while a directory was expected.");
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:11,代码来源:SvnUtil.java

示例7: getLatestExistent

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public long getLatestExistent() {
  if (! detectStartRevision()) return myStartNumber;

  SVNRepository repository = null;
  long latestOk = myStartNumber;
  try {
    repository = myVcs.createRepository(myUrl.toString());
    final SVNURL repRoot = repository.getRepositoryRoot(true);
    if (repRoot != null) {
      if (myEndNumber == -1) {
        myEndNumber = repository.getLatestRevision();
      }
      final String urlString = myUrl.toString().substring(repRoot.toString().length());
      for (long i = myStartNumber + 1; i < myEndNumber; i++) {
        final SVNNodeKind kind = repository.checkPath(urlString, i);
        if (SVNNodeKind.DIR.equals(kind) || SVNNodeKind.FILE.equals(kind)) {
          latestOk = i;
        }
      }
    }
  }
  catch (SVNException e) {
    //
  } finally {
    if (repository != null) {
      repository.closeSession();
    }
  }

  return latestOk;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:LatestExistentSearcher.java

示例8: exist

import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static SVNNodeKind exist(SVNRepository svnRepository, String path) throws SVNException {
	return svnRepository.checkPath(path, -1);
}
 
开发者ID:AgarwalNeha1,项目名称:gluu,代码行数:4,代码来源:SvnHelper.java


注:本文中的org.tmatesoft.svn.core.io.SVNRepository.checkPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。