1 /*****************************************************************************
5 * Creation date 14.11.2012
8 * @copyright OPEN CASCADE 2012-2014
9 *****************************************************************************/
11 package org.splat.service.dto;
14 * Document's file DTO.
16 public class FileDTO {
23 * True if the file is a result file for a document.
25 private boolean _isResult; // RKV: NOPMD: isResult method is used as getter
27 * File state: "Y" - actual, "O" - outdated, "N" - taken from other study.
31 * Automatic processing instruction: "file-import", "file-download", etc.
33 private String _processing;
35 * File path from the repository root.
40 * Constructor with initialization.
49 * processing instruction: file-download or file-import
51 * true if the file is result
53 public FileDTO(final long id, final String relativePath, final char state,
54 final String processing, final boolean isResult) {
58 _processing = processing;
63 * Constructor with partial initialization.
68 public FileDTO(final String relativePath) {
75 * @return the isResult
77 public boolean isResult() {
87 public void setResult(final boolean isResult) {
96 public char getState() {
106 public void setState(final char state) {
111 * Get the processing.
113 * @return the processing
115 public String getProcessing() {
120 * Set the processing.
123 * the processing to set
125 public void setProcessing(final String processing) {
126 _processing = processing;
134 public String getPath() {
144 public void setPath(final String path) {
151 * @see java.lang.Object#toString()
154 public String toString() {
155 StringBuffer buf = new StringBuffer();
157 String ftype = "Source";
161 String fstate = "file-actual";
162 if (getState() == 'O') {
163 fstate = "file-outdated";
165 buf.append(indent).append(ftype).append(" file: ").append(getPath())
166 .append('\n').append(indent).append(" File ID: ").append(
167 getId()).append('\n').append(indent).append(
168 " Automatic processing: ").append(getProcessing())
169 .append('\n').append(indent).append(" State: ").append(
170 fstate).append('\n');
171 return buf.toString();
179 public Long getId() {
189 public void setId(final Long id) {