001: package ru.emdev.EmForge.svn.web;
002:
003: /**
004: * Value object to show changed files information
005: *
006: * @author Walter Mourao
007: */
008: public class ChangedFile implements java.io.Serializable {
009: /**
010: * The serial version UID of this class. Needed for serialization.
011: */
012: private static final long serialVersionUID = -1568787779631198953L;
013:
014: public ChangedFile() {
015: }
016:
017: public ChangedFile(java.lang.String path, char changeKind,
018: java.lang.String fileContent, boolean isTextType,
019: java.lang.String mimeType) {
020: this .path = path;
021: this .changeKind = changeKind;
022: this .fileContent = fileContent;
023: this .textType = isTextType;
024: this .mimeType = mimeType;
025: }
026:
027: /**
028: * Copies constructor from other ChangedFile
029: *
030: * @param otherBean, cannot be <code>null</code>
031: * @throws java.lang.NullPointerException if the argument is <code>null</code>
032: */
033: public ChangedFile(ChangedFile otherBean) {
034: this (otherBean.getPath(), otherBean.getChangeKind(), otherBean
035: .getFileContent(), otherBean.isTextType(), otherBean
036: .getMimeType());
037: }
038:
039: /**
040: * Copies all properties from the argument value object into this value object.
041: */
042: public void copy(ChangedFile otherBean) {
043: if (otherBean != null) {
044: this .setPath(otherBean.getPath());
045: this .setChangeKind(otherBean.getChangeKind());
046: this .setFileContent(otherBean.getFileContent());
047: this .setTextType(otherBean.isTextType());
048: this .setMimeType(otherBean.getMimeType());
049: }
050: }
051:
052: private java.lang.String path;
053:
054: /**
055: * File path
056: */
057: public java.lang.String getPath() {
058: return this .path;
059: }
060:
061: public void setPath(java.lang.String path) {
062: this .path = path;
063: }
064:
065: private char changeKind;
066:
067: /**
068: * Change kind: M=Modified, A=Added, C=Copied
069: */
070: public char getChangeKind() {
071: return this .changeKind;
072: }
073:
074: public void setChangeKind(char changeKind) {
075: this .changeKind = changeKind;
076: }
077:
078: private java.lang.String fileContent;
079:
080: /**
081: * File content
082: */
083: public java.lang.String getFileContent() {
084: return this .fileContent;
085: }
086:
087: public void setFileContent(java.lang.String fileContent) {
088: this .fileContent = fileContent;
089: }
090:
091: private boolean textType;
092:
093: /**
094: * True if the file is text, false if not
095: */
096: public boolean isTextType() {
097: return this .textType;
098: }
099:
100: public void setTextType(boolean textType) {
101: this .textType = textType;
102: }
103:
104: private java.lang.String mimeType;
105:
106: /**
107: * File mime type
108: */
109: public java.lang.String getMimeType() {
110: return this .mimeType;
111: }
112:
113: public void setMimeType(java.lang.String mimeType) {
114: this.mimeType = mimeType;
115: }
116:
117: }
|