Salome HOME
Processing instruction is defined now in getScenarioInfo using document types mappings.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / dto / FileDTO.java
index 4c0cd8c391a57239927a1a32e45888f3e1abc31c..b7ba42f1487b6b5dc6c22a4e59c5b2cbaf3e7493 100644 (file)
@@ -39,10 +39,17 @@ public class FileDTO {
         *            relative file path
         * @param state
         *            file state
+        * @param processing
+        *            processing instruction: file-download or file-import
+        * @param isResult
+        *            true if the file is result
         */
-       public FileDTO(final String relativePath, final char state) {
+       public FileDTO(final String relativePath, final char state,
+                       final String processing, final boolean isResult) {
                _path = relativePath;
                _state = state;
+               _processing = processing;
+               _isResult = isResult;
        }
 
        /**
@@ -120,4 +127,29 @@ public class FileDTO {
        public void setPath(final String path) {
                _path = path;
        }
+
+       /**
+        * {@inheritDoc}
+        * 
+        * @see java.lang.Object#toString()
+        */
+       @Override
+       public String toString() {
+               StringBuffer buf = new StringBuffer();
+               String indent = "        ";
+               String ftype = "Source";
+               if (isResult()) {
+                       ftype = "Result";
+               }
+               String fstate = "file-actual";
+               if (getState() == 'O') {
+                       fstate = "file-outdated";
+               }
+               buf.append(indent).append(ftype).append(" file: ").append(getPath())
+                               .append('\n').append(indent).append(
+                                               "    Automatic processing: ").append(getProcessing())
+                               .append('\n').append(indent).append("    State: ").append(
+                                               fstate).append('\n');
+               return buf.toString();
+       }
 }