1 /*****************************************************************************
5 * Creation date 14.11.2012
8 * @copyright OPEN CASCADE 2012
9 *****************************************************************************/
11 package org.splat.service.dto;
14 * Document's file DTO.
16 public class FileDTO {
19 * True if the file is a result file for a document.
21 private boolean _isResult; // RKV: NOPMD: isResult method is used as getter
23 * File state: "Y" - actual, "O" - outdated, "N" - taken from other study.
27 * Automatic processing instruction: "file-import", "file-download", etc.
29 private String _processing;
31 * File path from the repository root.
36 * Constructor with initialization.
43 * processing instruction: file-download or file-import
45 * true if the file is result
47 public FileDTO(final String relativePath, final char state,
48 final String processing, final boolean isResult) {
51 _processing = processing;
58 * @return the isResult
60 public boolean isResult() {
70 public void setResult(final boolean isResult) {
79 public char getState() {
89 public void setState(final char state) {
96 * @return the processing
98 public String getProcessing() {
103 * Set the processing.
106 * the processing to set
108 public void setProcessing(final String processing) {
109 _processing = processing;
117 public String getPath() {
127 public void setPath(final String path) {
134 * @see java.lang.Object#toString()
137 public String toString() {
138 StringBuffer buf = new StringBuffer();
140 String ftype = "Source";
144 String fstate = "file-actual";
145 if (getState() == 'O') {
146 fstate = "file-outdated";
148 buf.append(indent).append(ftype).append(" file: ").append(getPath())
149 .append('\n').append(indent).append(
150 " Automatic processing: ").append(getProcessing())
151 .append('\n').append(indent).append(" State: ").append(
152 fstate).append('\n');
153 return buf.toString();