Search in sources :

Example 6 with SVNDirEntry

use of org.tmatesoft.svn.core.SVNDirEntry in project Gargoyle by callakrsos.

the class CommandTest3 method scenarioTest.

/**
	 *
	 * ################# 시나리오 테스트 ###################
	 *
	 * 1. svn 디렉토리 파일목록만 추출.
	 *
	 * 2. 추출된 파일목록에서 컨텐츠 조회
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 5. 13.
	 */
@Test
public void scenarioTest() {
    List<SVNDirEntry> list = testServerManager.listEntry("/sos/pass-batch-core");
    Optional<String> findFirst = list.stream().filter(e -> {
        SVNNodeKind kind = e.getKind();
        if (SVNNodeKind.FILE == kind)
            return true;
        return false;
    }).map(e -> {
        try {
            SVNURL url = e.getURL();
            SVNURL repositoryRoot = e.getRepositoryRoot();
            String relativeURL = SVNURLUtil.getRelativeURL(repositoryRoot, url, true);
            return relativeURL;
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        return "error";
    }).peek(e -> {
        System.out.println(testServerManager.cat(e));
    }).findFirst();
    // 첫번째 데이터를 찾은후...
    findFirst.ifPresent(url -> {
        try {
            File outDir = new File("c://sampleDir");
            outDir.mkdir();
            System.out.println("checout dir ::: " + outDir.getAbsolutePath());
            System.out.println("checout url ::: " + url);
            Long checkout = testServerManager.checkout(url, outDir);
            System.out.println("result ::: " + checkout);
        } catch (Exception e1) {
            e1.printStackTrace();
        }
    });
}
Also used : Date(java.util.Date) JavaSVNManager(com.kyj.scm.manager.svn.java.JavaSVNManager) SVNDirEntry(org.tmatesoft.svn.core.SVNDirEntry) Locale(java.util.Locale) FileUtil(com.kyj.fx.voeditor.visual.util.FileUtil) ParseException(java.text.ParseException) Before(org.junit.Before) ProxyInitializable(com.kyj.fx.voeditor.visual.main.initalize.ProxyInitializable) Properties(java.util.Properties) SVNURLUtil(org.tmatesoft.svn.core.internal.util.SVNURLUtil) SVNException(org.tmatesoft.svn.core.SVNException) SVNNodeKind(org.tmatesoft.svn.core.SVNNodeKind) FileWriter(java.io.FileWriter) IOException(java.io.IOException) Test(org.junit.Test) FileInputStream(java.io.FileInputStream) SVNCommitInfo(org.tmatesoft.svn.core.SVNCommitInfo) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) List(java.util.List) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) SVNURL(org.tmatesoft.svn.core.SVNURL) Optional(java.util.Optional) DateUtil(com.kyj.fx.voeditor.visual.util.DateUtil) Assert(org.junit.Assert) SVNDirEntry(org.tmatesoft.svn.core.SVNDirEntry) SVNNodeKind(org.tmatesoft.svn.core.SVNNodeKind) SVNURL(org.tmatesoft.svn.core.SVNURL) File(java.io.File) ParseException(java.text.ParseException) SVNException(org.tmatesoft.svn.core.SVNException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) Test(org.junit.Test)

Example 7 with SVNDirEntry

use of org.tmatesoft.svn.core.SVNDirEntry in project Gargoyle by callakrsos.

the class SVNListTest method recently.

@Test
public void recently() {
    Properties properties = new Properties();
    properties.put(JavaSVNManager.SVN_URL, "http://localhost:11121/svn/sample2/");
    properties.put(JavaSVNManager.SVN_USER_ID, "kyjun.kim");
    properties.put(JavaSVNManager.SVN_USER_PASS, "kyjun.kim");
    JavaSVNManager manager = new JavaSVNManager(properties);
    List<SVNDirEntry> listEntry = manager.listEntry("/", "-1", System.err::println);
    listEntry.forEach(System.out::println);
}
Also used : JavaSVNManager(com.kyj.scm.manager.svn.java.JavaSVNManager) SVNDirEntry(org.tmatesoft.svn.core.SVNDirEntry) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

SVNDirEntry (org.tmatesoft.svn.core.SVNDirEntry)7 SVNRepository (org.tmatesoft.svn.core.io.SVNRepository)5 ArrayList (java.util.ArrayList)4 SVNException (org.tmatesoft.svn.core.SVNException)4 SVNURL (org.tmatesoft.svn.core.SVNURL)3 JavaSVNManager (com.kyj.scm.manager.svn.java.JavaSVNManager)2 Properties (java.util.Properties)2 Test (org.junit.Test)2 SVNNodeKind (org.tmatesoft.svn.core.SVNNodeKind)2 ProxyInitializable (com.kyj.fx.voeditor.visual.main.initalize.ProxyInitializable)1 DateUtil (com.kyj.fx.voeditor.visual.util.DateUtil)1 FileUtil (com.kyj.fx.voeditor.visual.util.FileUtil)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 Date (java.util.Date)1 LinkedList (java.util.LinkedList)1