Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadMail
Commits
7c95accd
Commit
7c95accd
authored
Oct 22, 2020
by
Locatelli
Browse files
check where is session.properties
parent
ecda6cf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
7c95accd
...
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
nomadmail
</artifactId>
<version>
2.0.
0
</version>
<version>
2.0.
1
</version>
<name>
NomadMail
</name>
<description>
Helper application to use Nomad server to send mails from VMs
</description>
...
...
src/main/java/fr/ill/ics/mail/MailSender.java
View file @
7c95accd
...
...
@@ -17,7 +17,9 @@
*/
package
fr.ill.ics.mail
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.nio.file.Files
;
import
java.util.Properties
;
import
fr.ill.ics.cameo.Application
;
...
...
@@ -35,6 +37,7 @@ public class MailSender {
private
String
mailRecipients
;
public
static
String
FILE_SEPARATOR
=
System
.
getProperty
(
"file.separator"
);
public
static
String
HOME_DIRECTORY
=
System
.
getenv
(
"HOME"
);
public
static
String
NOMADENDPOINT_DIRECTORY
=
System
.
getProperty
(
"java.io.tmpdir"
)
+
FILE_SEPARATOR
+
"nomad"
;
public
static
String
NOMADENDPOINT_FILE
=
"session.properties"
;
public
static
String
NOMADMAIL
=
"nomadmail"
;
...
...
@@ -55,7 +58,16 @@ public class MailSender {
private
void
connectToServer
()
{
String
sessionPropertiesFile
=
NOMADENDPOINT_DIRECTORY
+
FILE_SEPARATOR
+
NOMADENDPOINT_FILE
;
String
sessionPropertiesFile
;
File
file
=
new
File
(
NOMADENDPOINT_DIRECTORY
+
FILE_SEPARATOR
+
NOMADENDPOINT_FILE
);
if
(
file
.
exists
())
{
sessionPropertiesFile
=
NOMADENDPOINT_DIRECTORY
+
FILE_SEPARATOR
+
NOMADENDPOINT_FILE
;
}
else
{
sessionPropertiesFile
=
HOME_DIRECTORY
+
FILE_SEPARATOR
+
NOMADENDPOINT_FILE
;
}
Properties
sessionProperties
=
new
Properties
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment