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
2c6e94e2
Commit
2c6e94e2
authored
Jun 18, 2015
by
helene ortiz
Browse files
Adapt PropertyManager class for compatibility with NomadServerGUI
parent
93beaf9b
Changes
2
Show whitespace changes
Inline
Side-by-side
src/fr/ill/ics/core/property/PropertyManager.java
View file @
2c6e94e2
...
...
@@ -79,6 +79,8 @@ public class PropertyManager {
private
Map
<
String
,
String
>
sizePropertyNames
;
// KEY=controllerType.propertyName VALUE=size property name
private
String
nomadHome
;
/** -------------------------------------------------------------------------------------------------- **/
private
static
PropertyManager
instance
=
null
;
...
...
@@ -99,6 +101,8 @@ public class PropertyManager {
*
*/
public
void
init
()
{
nomadHome
=
System
.
getenv
(
"NOMADCLIENT_HOME"
);
clientFilesFoundPerControllerType
=
new
HashMap
<
String
,
Boolean
>();
sizePropertyNames
=
new
HashMap
<
String
,
String
>();
propertyParser
=
new
PropertyParser
();
...
...
@@ -114,6 +118,7 @@ public class PropertyManager {
Iterator
<
ClientServantDescriptor
>
it
=
ServantDatabase
.
getInstance
().
getDrivers
().
iterator
();
while
(
it
.
hasNext
())
{
ClientServantDescriptor
descriptor
=
it
.
next
();
boolean
clientFilesExist
=
readPropertiesClientFilesFor
(
descriptor
.
getType
());
if
(
clientFilesExist
)
{
Controller
controller
=
DriverManager
.
getInstance
().
getDriver
(
descriptor
.
getName
());
...
...
@@ -151,7 +156,13 @@ public class PropertyManager {
return
clientFilesFoundPerControllerType
.
get
(
controllerType
);
}
String
[]
files
=
FileHelper
.
getFilesListByExtension
(
ConfigManager
.
CONTROLLERS_DIRECTORY
+
controllerType
+
ConfigManager
.
FILE_SEPARATOR
,
ConfigManager
.
PROPERTIES_PATTERN
,
true
,
true
);
// Necessary for NomadServerGUI: the client project of the PropertyManager can be another project that NomadGUI, but the client files remain in NomadGUI
String
prefix
=
""
;
if
(
nomadHome
!=
null
)
{
prefix
=
nomadHome
+
ConfigManager
.
FILE_SEPARATOR
;
}
String
[]
files
=
FileHelper
.
getFilesListByExtension
(
prefix
+
ConfigManager
.
CONTROLLERS_DIRECTORY
+
controllerType
+
ConfigManager
.
FILE_SEPARATOR
,
ConfigManager
.
PROPERTIES_PATTERN
,
true
,
true
);
if
(
files
==
null
||
files
.
length
==
0
)
{
// Search on server side
...
...
src/fr/ill/ics/util/ConfigManager.java
View file @
2c6e94e2
...
...
@@ -151,8 +151,18 @@ public class ConfigManager {
properties
=
new
Properties
();
// Load all properties file from conf directory
List
<
String
>
propertiesFiles
=
new
ArrayList
<
String
>(
Arrays
.
asList
(
FileHelper
.
getFilesListByExtension
(
CLIENT_CONF_DIRECTORY
,
PROPERTIES_EXTENSION
,
true
,
true
)));
propertiesFiles
.
addAll
(
new
ArrayList
<
String
>(
Arrays
.
asList
(
FileHelper
.
getFilesListByExtension
(
SERVER_CONF_DIRECTORY
,
PROPERTIES_EXTENSION
,
true
,
true
))));
List
<
String
>
propertiesFiles
=
new
ArrayList
<
String
>();
String
[]
files
=
FileHelper
.
getFilesListByExtension
(
CLIENT_CONF_DIRECTORY
,
PROPERTIES_EXTENSION
,
true
,
true
);
if
(
files
!=
null
)
{
propertiesFiles
.
addAll
(
Arrays
.
asList
(
files
));
}
files
=
FileHelper
.
getFilesListByExtension
(
SERVER_CONF_DIRECTORY
,
PROPERTIES_EXTENSION
,
true
,
true
);
if
(
files
!=
null
)
{
propertiesFiles
.
addAll
(
Arrays
.
asList
(
files
));
}
Iterator
<
String
>
it
=
propertiesFiles
.
iterator
();
while
(
it
.
hasNext
())
{
...
...
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