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


Java SVNRepository.getDir方法代码示例

本文整理汇总了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;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:34,代码来源:SVNList.java

示例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());
        }
    }
}
 
开发者ID:friedlwo,项目名称:AppWoksUtils,代码行数:20,代码来源:Subversion.java

示例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;
}
 
开发者ID:lithiumtech,项目名称:flow,代码行数:17,代码来源:SvnFiler.java

示例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());
		}
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:18,代码来源:SvnUtil.java

示例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;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:20,代码来源:SvnUtil.java

示例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();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:SvnUtil.java

示例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);
            }
        }
    }
}
 
开发者ID:klask-io,项目名称:klask-io,代码行数:46,代码来源:TestCheckOut.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnNativeClientAuthTest.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnProtocolsTest.java

示例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();
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:RepositoryLoader.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:SvnNativeClientAuthTest.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:SvnProtocolsTest.java

示例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);
}
 
开发者ID:bozaro,项目名称:git-as-svn,代码行数:6,代码来源:SvnTestHelper.java


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