Salome HOME
Copyrights update 2015.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / som / File.java
index 9da39a7d126e2c6e32a953ee1a56e7d699ac6fdc..702d823467387c164d066977fb22eb04ae437a37 100644 (file)
@@ -7,7 +7,7 @@ package org.splat.dal.bo.som;
  * physical file may not exist at instantiation time.
  * 
  * @author    Daniel Brunier-Coulin
- * @copyright OPEN CASCADE 2012
+ * @copyright OPEN CASCADE 2012-2015
  */
 
 import java.util.Calendar;
@@ -37,7 +37,7 @@ public class File extends Persistent {
       this.myfile = null;
     }
 //  Internal constructors
-    protected File (String path) {
+    public File (final String path) {
 //  ----------------------------
       Calendar  current = Calendar.getInstance();
       String[]  table   = path.split("\\x2E");
@@ -47,7 +47,7 @@ public class File extends Persistent {
       this.date   = current.getTime();     // Today
       this.myfile = null;
     }
-    protected File (String path, String format, Date date) {
+    protected File (final String path, final String format, final Date date) {
 //  ------------------------------------------------------
       this.path   = path;                  // The corresponding physical file may not exist yet
       this.format = format;                // The format name may be different from the physical file extension
@@ -69,7 +69,9 @@ public class File extends Persistent {
  */
     public java.io.File asFile () {
 //  -----------------------------
-      if (myfile == null) myfile = new java.io.File(Database.getRepositoryVaultPath() + path);
+      if (myfile == null) {
+               myfile = new java.io.File(Database.getRepositoryVaultPath() + path);
+       }
       return myfile;
     }
 
@@ -102,9 +104,16 @@ public class File extends Persistent {
 //  Protected service
 //  ==============================================================================================================================
 
-    protected void changePath (String path) {
+    public void changePath (final String path) {
 //  ---------------------------------------
       this.path   = path;
       this.myfile = null;
     }
+       /**
+        * Set the date.
+        * @param date the date to set
+        */
+       public void setDate(final Date date) {
+               this.date = date;
+       }
 }
\ No newline at end of file