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
NomadCommandSystem
Commits
534408fe
Commit
534408fe
authored
Apr 16, 2020
by
helene ortiz
Browse files
allow virtual clients to set their own home directory
parent
3639c498
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/util/ConfigManager.java
View file @
534408fe
...
...
@@ -63,7 +63,7 @@ public class ConfigManager {
public
final
static
String
VIEW_PATTERN
=
"View.xml"
;
public
final
static
String
COMMAND_VIEW_PATTERN
=
"CommandView.xml"
;
public
static
final
String
D
OT_NOMAD
_DIRECTORY
=
".nomad"
;
public
static
final
String
D
EFAULT_LOCAL_FILES
_DIRECTORY
=
".nomad"
;
public
static
final
String
NOMAD_CHAT_FILES
=
".nomadChats"
;
public
final
static
String
USER_HOME
=
System
.
getProperty
(
"user.home"
);
...
...
@@ -121,6 +121,7 @@ public class ConfigManager {
private
boolean
mainClient
=
true
;
private
String
clientType
;
private
String
localFilesDirectory
=
DEFAULT_LOCAL_FILES_DIRECTORY
;
/**
* @return the unique instance of this class
...
...
@@ -626,4 +627,22 @@ public class ConfigManager {
public
String
getClientType
()
{
return
clientType
;
}
public
String
getLocalFilesDirectory
()
{
return
localFilesDirectory
;
}
public
void
setLocalFilesDirectory
(
String
localFilesDirectory
)
{
if
(!
new
File
(
localFilesDirectory
).
exists
())
{
// Directory does not exist: create it
File
file
=
new
File
(
localFilesDirectory
);
file
.
mkdir
();
}
if
(!
new
File
(
localFilesDirectory
+
ConfigManager
.
FILE_SEPARATOR
+
ConfigManager
.
NOMAD_CHAT_FILES
).
exists
())
{
// Directory for chat's files does not exist: create it
File
file
=
new
File
(
localFilesDirectory
+
ConfigManager
.
FILE_SEPARATOR
+
ConfigManager
.
NOMAD_CHAT_FILES
);
file
.
mkdir
();
}
this
.
localFilesDirectory
=
localFilesDirectory
;
}
}
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