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;
56 * Constructor with initialization.
61 public FileDTO(final String relativePath) {
68 * @return the isResult
70 public boolean isResult() {
80 public void setResult(final boolean isResult) {
89 public char getState() {
99 public void setState(final char state) {
104 * Get the processing.
106 * @return the processing
108 public String getProcessing() {
113 * Set the processing.
116 * the processing to set
118 public void setProcessing(final String processing) {
119 _processing = processing;
127 public String getPath() {
137 public void setPath(final String path) {
144 * @see java.lang.Object#toString()
147 public String toString() {
148 StringBuffer buf = new StringBuffer();
150 String ftype = "Source";
154 String fstate = "file-actual";
155 if (getState() == 'O') {
156 fstate = "file-outdated";
158 buf.append(indent).append(ftype).append(" file: ").append(getPath())
159 .append('\n').append(indent).append(
160 " Automatic processing: ").append(getProcessing())
161 .append('\n').append(indent).append(" State: ").append(
162 fstate).append('\n');
163 return buf.toString();