com.lrodriguez.SVNEntryFacade.java Source code

Java tutorial

Introduction

Here is the source code for com.lrodriguez.SVNEntryFacade.java

Source

/*
 Copyright (c) <2009> <Leonardo Rodriguez-Velez draco_rosa@hotmail.com>
    
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:
    
 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.
    
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
    
*/

package com.lrodriguez;

import java.io.File;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

import org.apache.commons.io.comparator.PathFileComparator;
import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNLogEntryPath;
import org.tmatesoft.svn.core.SVNNodeKind;

public class SVNEntryFacade implements Serializable {
    public File file;
    public String author;
    public Date timestamp;
    public String message;
    public long revision;
    public String copyPath;
    public long copyRevision;
    public String path;
    public String type;
    public String nodeKind;

    public SVNLogEntry logEntry;

    public boolean selected;

    public SVNEntryFacade(File file, SVNLogEntryPath entryPath, SVNLogEntry logEntry, boolean selected) {
        this.logEntry = logEntry;
        this.file = file;
        this.author = logEntry.getAuthor();
        this.timestamp = logEntry.getDate();
        this.message = logEntry.getMessage();
        this.revision = logEntry.getRevision();

        this.copyPath = entryPath.getCopyPath();
        this.copyRevision = entryPath.getCopyRevision();
        this.path = entryPath.getPath();
        this.type = new Character(entryPath.getType()).toString();
        this.nodeKind = entryPath.getKind().toString();

    }

    public boolean equals(Object entry) {
        return (((SVNEntryFacade) entry).getPath().equals(this.getPath()));
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public long getRevision() {
        return revision;
    }

    public void setRevision(long revision) {
        this.revision = revision;
    }

    public String getCopyPath() {
        return copyPath;
    }

    public void setCopyPath(String copyPath) {
        this.copyPath = copyPath;
    }

    public long getCopyRevision() {
        return copyRevision;
    }

    public void setCopyRevision(long copyRevision) {
        this.copyRevision = copyRevision;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNodeKind() {
        return nodeKind;
    }

    public void setNodeKind(String nodeKind) {
        this.nodeKind = nodeKind;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public SVNLogEntry getLogEntry() {
        return logEntry;
    }

    public void setLogEntry(SVNLogEntry logEntry) {
        this.logEntry = logEntry;
    }

}