Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NomadGUI
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Instrument Control
NomadGUI
Commits
042d9b3a
Commit
042d9b3a
authored
1 year ago
by
helene ortiz
Browse files
Options
Downloads
Patches
Plain Diff
masters's spies
parent
570e3a3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/ill/ics/client/control/spy/SpyManager.java
+27
-0
27 additions, 0 deletions
src/main/java/fr/ill/ics/client/control/spy/SpyManager.java
with
27 additions
and
0 deletions
src/main/java/fr/ill/ics/client/control/spy/SpyManager.java
+
27
−
0
View file @
042d9b3a
...
...
@@ -259,9 +259,28 @@ public class SpyManager {
// Is there something to save ?
if
(
spyHolders
!=
null
&&
!
spyHolders
.
isEmpty
())
{
createSpiesFile
(
spiesFile
);
// Is this master client ?
if
(
ConfigManager
.
getInstance
().
isMasterClient
())
{
try
{
// Also save spies on instrument
String
xmlContent
=
FileUtils
.
readFileToString
(
spiesFile
,
"UTF-8"
);
ResourceManager
.
getInstance
().
saveFile
(
ConfigManager
.
getInstance
().
getString
(
"usersSpiesDir"
)
+
ConfigManager
.
FILE_SEPARATOR
+
USERS_SPIES_FILENAME
,
xmlContent
,
0
,
true
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
else
{
// Delete user spies file if any
spiesFile
.
delete
();
// Is this master client ?
if
(
ConfigManager
.
getInstance
().
isMasterClient
())
{
// Also delete spies on instrument
System
.
out
.
println
(
"DELETE FILE "
+
ConfigManager
.
getInstance
().
getString
(
"usersSpiesDir"
)
+
ConfigManager
.
FILE_SEPARATOR
+
USERS_SPIES_FILENAME
);
ResourceManager
.
getInstance
().
deleteFile
(
ConfigManager
.
getInstance
().
getString
(
"usersSpiesDir"
)
+
ConfigManager
.
FILE_SEPARATOR
+
USERS_SPIES_FILENAME
);
}
}
}
...
...
@@ -289,6 +308,14 @@ public class SpyManager {
}
else
{
// Delete user spies file if any
spiesFile
.
delete
();
// Is this master client ?
if
(
ConfigManager
.
getInstance
().
isMasterClient
())
{
// Also delete spies on instrument
System
.
out
.
println
(
"DELETE FILE "
+
ConfigManager
.
getInstance
().
getString
(
"usersSpiesDir"
)
+
ConfigManager
.
FILE_SEPARATOR
+
"."
+
USERS_SPIES_FILENAME
);
ResourceManager
.
getInstance
().
deleteFile
(
ConfigManager
.
getInstance
().
getString
(
"usersSpiesDir"
)
+
ConfigManager
.
FILE_SEPARATOR
+
"."
+
USERS_SPIES_FILENAME
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment