Search in sources :

Example 1 with ISVNLogEntryHandler

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

the class SVNLog method logFileSystem.

/********************************
	 * 작성일 : 2016. 7. 13. 작성자 : KYJ
	 *
	 *
	 * @param path
	 * @param startRevision
	 * @param endDate
	 * @param exceptionHandler
	 * @return
	 ********************************/
public List<SVNLogEntry> logFileSystem(File[] path, long startRevision, Date endDate, Consumer<Exception> exceptionHandler) {
    SVNLogClient logClient = getSvnManager().getLogClient();
    List<SVNLogEntry> result = new ArrayList<>();
    try {
        ISVNLogEntryHandler handler = logEntry -> {
            LOGGER.debug("path :: {}  rivision :: {} date :: {} author :: {} message :: {} ", path, logEntry.getRevision(), logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
            result.add(logEntry);
        };
        doLog(path, startRevision, endDate, logClient, handler);
    } catch (SVNException e) {
        LOGGER.error(ValueUtil.toString(e));
        if (exceptionHandler != null)
            exceptionHandler.accept(e);
    }
    return result;
}
Also used : ILogCommand(com.kyj.scm.manager.core.commons.ILogCommand) Properties(java.util.Properties) Logger(org.slf4j.Logger) URLDecoder(java.net.URLDecoder) SVNException(org.tmatesoft.svn.core.SVNException) Date(java.util.Date) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) File(java.io.File) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient) List(java.util.List) SVNRepository(org.tmatesoft.svn.core.io.SVNRepository) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) ArrayList(java.util.ArrayList) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNException(org.tmatesoft.svn.core.SVNException) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient)

Example 2 with ISVNLogEntryHandler

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

the class SVNLog method log.

/********************************
	 * 작성일 : 2016. 5. 5. 작성자 : KYJ
	 *
	 * 이력정보 조회
	 *
	 * @param path
	 *            상대경로
	 * @param revision
	 *            리비젼번호
	 * @param exceptionHandler
	 *            에러발생시 처리할 핸들 정의
	 * @return
	 ********************************/
public List<SVNLogEntry> log(String path, String revision, Consumer<Exception> exceptionHandler) {
    SVNLogClient logClient = getSvnManager().getLogClient();
    List<SVNLogEntry> result = new ArrayList<>();
    try {
        ISVNLogEntryHandler handler = logEntry -> {
            LOGGER.debug("rivision :: {} date :: {} author :: {} message :: {} ", logEntry.getRevision(), logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
            result.add(logEntry);
        };
        String _path = path;
        try {
            _path = URLDecoder.decode(_path, "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        logClient.doLog(getSvnURL(), new String[] { _path }, SVNRevision.create(Long.parseLong(revision)), SVNRevision.create(Long.parseLong(revision) == -1 ? 0 : Long.parseLong(revision)), SVNRevision.HEAD, true, false, 100L, handler);
    } catch (SVNException e) {
        if (exceptionHandler != null)
            exceptionHandler.accept(e);
        else
            LOGGER.error(ValueUtil.toString(e));
    }
    return result;
}
Also used : ILogCommand(com.kyj.scm.manager.core.commons.ILogCommand) Properties(java.util.Properties) Logger(org.slf4j.Logger) URLDecoder(java.net.URLDecoder) SVNException(org.tmatesoft.svn.core.SVNException) Date(java.util.Date) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) File(java.io.File) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient) List(java.util.List) SVNRepository(org.tmatesoft.svn.core.io.SVNRepository) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) ArrayList(java.util.ArrayList) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNException(org.tmatesoft.svn.core.SVNException) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient) SVNException(org.tmatesoft.svn.core.SVNException)

Example 3 with ISVNLogEntryHandler

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

the class SVNLog method log.

public List<SVNLogEntry> log(String path, long startRevision, Date endDate, Consumer<Exception> exceptionHandler) {
    SVNLogClient logClient = getSvnManager().getLogClient();
    List<SVNLogEntry> result = new ArrayList<>();
    try {
        ISVNLogEntryHandler handler = logEntry -> {
            LOGGER.debug("path :: {}  rivision :: {} date :: {} author :: {} message :: {} ", path, logEntry.getRevision(), logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
            result.add(logEntry);
        };
        logServer(path, startRevision, endDate, logClient, handler);
    } catch (SVNException e) {
        LOGGER.error(ValueUtil.toString(e));
        if (exceptionHandler != null)
            exceptionHandler.accept(e);
    }
    return result;
}
Also used : ILogCommand(com.kyj.scm.manager.core.commons.ILogCommand) Properties(java.util.Properties) Logger(org.slf4j.Logger) URLDecoder(java.net.URLDecoder) SVNException(org.tmatesoft.svn.core.SVNException) Date(java.util.Date) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) File(java.io.File) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient) List(java.util.List) SVNRepository(org.tmatesoft.svn.core.io.SVNRepository) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) ArrayList(java.util.ArrayList) ISVNLogEntryHandler(org.tmatesoft.svn.core.ISVNLogEntryHandler) SVNException(org.tmatesoft.svn.core.SVNException) SVNLogClient(org.tmatesoft.svn.core.wc.SVNLogClient)

Aggregations

ValueUtil (com.kyj.fx.voeditor.visual.util.ValueUtil)3 ILogCommand (com.kyj.scm.manager.core.commons.ILogCommand)3 File (java.io.File)3 URLDecoder (java.net.URLDecoder)3 ArrayList (java.util.ArrayList)3 Collection (java.util.Collection)3 Date (java.util.Date)3 List (java.util.List)3 Properties (java.util.Properties)3 Consumer (java.util.function.Consumer)3 Logger (org.slf4j.Logger)3 LoggerFactory (org.slf4j.LoggerFactory)3 ISVNLogEntryHandler (org.tmatesoft.svn.core.ISVNLogEntryHandler)3 SVNException (org.tmatesoft.svn.core.SVNException)3 SVNLogEntry (org.tmatesoft.svn.core.SVNLogEntry)3 SVNRepository (org.tmatesoft.svn.core.io.SVNRepository)3 SVNLogClient (org.tmatesoft.svn.core.wc.SVNLogClient)3 SVNRevision (org.tmatesoft.svn.core.wc.SVNRevision)3