Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Jury2016-05-23 15:18:39 -0400
committerAndrew M. Finkbeiner2016-10-06 21:12:02 -0400
commit11e6dd2475b02123e2a690ac147b1378b252d531 (patch)
treee9a5e8adfd176ca70df03c9c90a2b10f4ec12a6a
parentd38914ecc885ad5479ca312ab88525a6b1c7ce5e (diff)
downloadorg.eclipse.osee-11e6dd2475b02123e2a690ac147b1378b252d531.tar.gz
org.eclipse.osee-11e6dd2475b02123e2a690ac147b1378b252d531.tar.xz
org.eclipse.osee-11e6dd2475b02123e2a690ac147b1378b252d531.zip
feature[ats_ATS287891]: Update OTESERVER folder logic.
-rw-r--r--plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java33
1 files changed, 25 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java b/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
index aee418721c..a8478c12f4 100644
--- a/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
+++ b/plugins/org.eclipse.osee.ote.io/src/org/eclipse/osee/ote/io/internal/OTEFolderImpl.java
@@ -5,6 +5,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream.GetField;
+import java.net.UnknownHostException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -49,15 +50,31 @@ public class OTEFolderImpl implements OTEServerFolder{
private File currentServerFolder;
private static File determineOteServerFolder() {
- File oteStationParent = new File(OtePropertiesCore.oteServerFolder.getValue("undefined"));
- if (!oteStationParent.exists() || !oteStationParent.isDirectory()) {
- OseeLog.log(OTEFolderImpl.class, Level.WARNING, "ote server folder parent does not exist folder -" + oteStationParent.getAbsolutePath());
- oteStationParent = new File(OtePropertiesCore.userHome.getValue(), "OTESERVER");
- return oteStationParent;
+ String userHome = OtePropertiesCore.userHome.getValue();
+ if (userHome.equals("/root")){
+ userHome = "/home/mptest";
}
- File stationsFolder = new File(oteStationParent, "stations");
- File stationFolder = new File(stationsFolder, OtePropertiesCore.oteStationName.getValue("unknown-station"));
- return new File(stationFolder, OtePropertiesCore.userName.getValue());
+ File oteServerFolder = new File(userHome, "/OTESERVER");
+ try {
+ oteServerFolder = new File(oteServerFolder, java.net.InetAddress.getLocalHost().getHostName());
+ } catch (UnknownHostException ex) {
+ OseeLog.log(OTEFolderImpl.class, Level.WARNING, "Unknown host from java.net.InetAddress.getLocalHost() -");
+ }
+ oteServerFolder.setReadable(true);
+ oteServerFolder.setExecutable(true);
+ oteServerFolder.setWritable(true);
+
+ return oteServerFolder;
+
+// File oteStationParent = new File(OtePropertiesCore.oteServerFolder.getValue("undefined"));
+// if (!oteStationParent.exists() || !oteStationParent.isDirectory()) {
+// OseeLog.log(OTEFolderImpl.class, Level.WARNING, "ote server folder parent does not exist folder -" + oteStationParent.getAbsolutePath());
+// oteStationParent = new File(OtePropertiesCore.userHome.getValue(), "OTESERVER");
+// return oteStationParent;
+// }
+// File stationsFolder = new File(oteStationParent, "stations");
+// File stationFolder = new File(stationsFolder, OtePropertiesCore.oteStationName.getValue("unknown-station"));
+// return new File(stationFolder, OtePropertiesCore.userName.getValue());
}
public OTEFolderImpl(){

Back to the top