本文整理汇总了Java中org.tmatesoft.svn.core.io.SVNRepository.getDir方法的典型用法代码示例。如果您正苦于以下问题:Java SVNRepository.getDir方法的具体用法?Java SVNRepository.getDir怎么用?Java SVNRepository.getDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.io.SVNRepository
的用法示例。
在下文中一共展示了SVNRepository.getDir方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: list
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
/********************************
* 작성일 : 2016. 5. 4. 작성자 : KYJ
*
* path에 속하는 구성정보 조회
*
* @param path
* @param revision
* @param exceptionHandler
* @return
********************************/
public List<String> list(String path, String revision, Consumer<Exception> exceptionHandler) {
List<String> resultList = Collections.emptyList();
try {
SVNProperties fileProperties = new SVNProperties();
SVNRepository repository = getRepository();
Collection<SVNDirEntry> dir = repository.getDir(path, Long.parseLong(revision), fileProperties, new ArrayList<>());
resultList = dir.stream().map(d -> {
SVNNodeKind kind = d.getKind();
if (SVNNodeKind.DIR == kind) {
return d.getRelativePath().concat("/");
} else {
return d.getRelativePath();
}
}).collect(Collectors.toList());
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return resultList;
}
示例2: listEntries
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static void listEntries(final SVNRepository repository, final File root, final int i, final String path) throws SVNException, IOException {
final Collection entries = repository.getDir(path, i, null, (Collection) null);
final File revroot = new File(root, i + "");
revroot.mkdirs();
final Iterator iterator = entries.iterator();
while (iterator.hasNext()) {
final SVNDirEntry entry = (SVNDirEntry) iterator.next();
final File file = new File(revroot, (path.equals("") ? "" : path + "/") + entry.getName());
if (entry.getKind() == SVNNodeKind.DIR) {
file.mkdirs();
} else {
file.delete();
IO.writeStringToFile(file, "author=" + entry.getAuthor() + "\r\nrevision=" + entry.getRevision() + "\r\ndate=" + entry.getDate());
}
if (entry.getKind() == SVNNodeKind.DIR) {
listEntries(repository, root, i, (path.equals("")) ? entry.getName() : path + "/" + entry.getName());
}
}
}
示例3: listRecords
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
@Override
@Nonnull
public List<Record> listRecords(@Nonnull String path) throws IOException {
List<Record> records = new ArrayList<>();
if (getRecord(path).exists()) {
SVNRepository repository = svnProvider.getRepository();
try {
repository.getDir(path, revision, new SVNProperties(), entry -> records.add(getRecord(entry, path)));
} catch (SVNException e) {
throw new IOException("failed to get file records: " + getFullPath(path), e);
} finally {
svnProvider.releaseRepository(repository);
}
}
return records;
}
示例4: listEntries
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static void listEntries(SVNRepository repository, String path)
throws SVNException {
Collection<?> entries = repository.getDir(path, -1, null,
(Collection<?>) null);
Iterator<?> iterator = entries.iterator();
while (iterator.hasNext()) {
SVNDirEntry entry = (SVNDirEntry) iterator.next();
System.out.println("/" + (path.equals("") ? "" : path + "/")
+ entry.getName() + " (author: '" + entry.getAuthor()
+ "'; revision: " + entry.getRevision() + "; date: "
+ entry.getDate() + ")");
if (entry.getKind() == SVNNodeKind.DIR) {
listEntries(repository, (path.equals("")) ? entry.getName()
: path + "/" + entry.getName());
}
}
}
示例5: getEntries
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static List<SVNDirEntry> getEntries(SVNRepository repository,
String path) throws SVNException {
Collection<?> entries = repository.getDir(path, -1, null,
(Collection<?>) null);
List<SVNDirEntry> entryURLs = new ArrayList<SVNDirEntry>();
Iterator<?> iterator = entries.iterator();
while (iterator.hasNext()) {
SVNDirEntry entry = (SVNDirEntry) iterator.next();
entryURLs.add(entry);
if (entry.getKind() == SVNNodeKind.DIR) {
entryURLs.addAll(getEntries(repository,
(path.equals("")) ? entry.getName() : path + "/"
+ entry.getName()));
}
}
return entryURLs;
}
示例6: remoteFolderIsEmpty
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static boolean remoteFolderIsEmpty(final SvnVcs vcs, final String url) throws SVNException {
SVNRepository repository = null;
try {
repository = vcs.createRepository(url);
final Ref<Boolean> result = new Ref<Boolean>(true);
repository.getDir("", -1, null, new ISVNDirEntryHandler() {
public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
if (dirEntry != null) {
result.set(false);
}
}
});
return result.get();
} finally {
if (repository != null) {
repository.closeSession();
}
}
}
示例7: traverse
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
/**
* Méthode traverse.<br>
* Rôle :
*
* @param updateClient
* @param repository
* @param checkoutRootPath
* @param destRootPath
* @param repoPath
* @param evictTags : si on tombe une première fois sur trunk, branches ou tags, alors on n'élague plus les nouvelles occurrences rencontrées
* @throws SVNException
*/
public static void traverse(final SVNUpdateClient updateClient, final SVNRepository repository, final String checkoutRootPath, final String destRootPath, final String repoPath,
final boolean evictTags) throws SVNException {
System.out.println(repoPath);
if (!evictTags) {
checkout(updateClient, checkoutRootPath, destRootPath, repoPath, SVNDepth.INFINITY);
} else {
checkout(updateClient, checkoutRootPath, destRootPath, repoPath, SVNDepth.FILES);
final Collection<SVNDirEntry> entries = repository.getDir(repoPath, -1, null, (Collection) null);
for (final SVNDirEntry entry : entries) {
if (entry.getKind() != SVNNodeKind.DIR) {
continue;
}
boolean copieEvict = evictTags;
if (motsClefsSVN.contains(entry.getName())) {
copieEvict = false;
}
//si on doit encore passer le niveau tags/branches/trunk et que le rép courant n'est pas tags, alors on poursuit
if (!entry.getName().equalsIgnoreCase(TAGS)) {
traverse(
updateClient,
repository,
checkoutRootPath,
destRootPath,
repoPath.equals("") ? entry.getName() : repoPath + "/" + entry.getName(),
copieEvict);
}
}
}
}
示例8: testBrowseRepositoryImpl
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<SVNDirEntry>();
final SVNRepository repository = myVcs.getSvnKitManager().createRepository(url);
repository.getDir(".", -1, null, new ISVNDirEntryHandler() {
@Override
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException {
list.add(dirEntry);
}
});
Assert.assertTrue(!list.isEmpty());
}
示例9: testBrowseRepositoryImpl
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<SVNDirEntry>();
final SVNRepository repository = myVcs.getSvnKitManager().createRepository(url);
repository.getDir(".", -1, null, new ISVNDirEntryHandler() {
@Override
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException {
list.add(dirEntry);
}
});
Assert.assertTrue(! list.isEmpty());
}
示例10: run
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public void run() {
final Collection<SVNDirEntry> entries = new TreeSet<SVNDirEntry>();
final RepositoryTreeNode node = myData.first;
final SvnVcs vcs = node.getVcs();
SVNRepository repository = null;
SvnAuthenticationProvider.forceInteractive();
try {
repository = vcs.createRepository(node.getURL().toString());
repository.getDir("", -1, null, new ISVNDirEntryHandler() {
public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
entries.add(dirEntry);
}
});
} catch (final SVNException e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
setError(myData, e.getErrorMessage());
startNext();
}
});
return;
} finally {
SvnAuthenticationProvider.clearInteractive();
if (repository != null) {
repository.closeSession();
}
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
setResults(myData, new ArrayList<SVNDirEntry>(entries));
startNext();
}
});
}
示例11: testBrowseRepositoryImpl
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<SVNDirEntry>();
final SVNRepository repository = myVcs.createRepository(url);
repository.getDir(".", -1, null, new ISVNDirEntryHandler() {
@Override
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException {
list.add(dirEntry);
}
});
Assert.assertTrue(!list.isEmpty());
}
示例12: testBrowseRepositoryImpl
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
private void testBrowseRepositoryImpl(final String url) throws SVNException {
final List<SVNDirEntry> list = new ArrayList<SVNDirEntry>();
final SVNRepository repository = myVcs.createRepository(url);
repository.getDir(".", -1, null, new ISVNDirEntryHandler() {
@Override
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException {
list.add(dirEntry);
}
});
Assert.assertTrue(! list.isEmpty());
}
示例13: checkDirProp
import org.tmatesoft.svn.core.io.SVNRepository; //导入方法依赖的package包/类
public static void checkDirProp(@NotNull SVNRepository repo, @NotNull String filePath, @Nullable Map<String, String> expected) throws SVNException {
SVNProperties props = new SVNProperties();
repo.getDir(filePath, repo.getLatestRevision(), props, new ArrayList<>());
checkProp(props, expected);
}