Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
93cbc091
Commit
93cbc091
authored
Jun 06, 2018
by
Costin Grigoras
Browse files
Work around the deprecation of Observable
parent
234670e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/lazyj.jar
View file @
93cbc091
No preview for this file type
src/alien/config/ConfigUtils.java
View file @
93cbc091
...
...
@@ -3,6 +3,8 @@
*/
package
alien.config
;
import
java.beans.PropertyChangeEvent
;
import
java.beans.PropertyChangeListener
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
...
...
@@ -22,8 +24,6 @@ import java.util.HashMap;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.jar.JarEntry
;
...
...
@@ -385,7 +385,7 @@ public class ConfigUtils {
* @author costing
* @since Nov 3, 2010
*/
static
class
LoggingConfigurator
implements
Observ
er
{
static
class
LoggingConfigurator
implements
PropertyChangeListen
er
{
/**
* Logging configuration content, usually loaded from "logging.properties"
*/
...
...
@@ -399,13 +399,13 @@ public class ConfigUtils {
LoggingConfigurator
(
final
ExtProperties
p
)
{
prop
=
p
;
prop
.
add
Observer
(
this
);
prop
.
add
PropertyChangeListener
(
null
,
this
);
update
(
null
,
null
);
propertyChange
(
null
);
}
@Override
public
void
update
(
final
Observable
o
,
final
Objec
t
arg
)
{
public
void
propertyChange
(
final
PropertyChangeEven
t
arg
0
)
{
final
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
try
{
...
...
@@ -568,7 +568,7 @@ public class ConfigUtils {
}
// We create the folders logdir, cachedir, tmpdir, workdir
HashMap
<
String
,
String
>
folders_config
=
new
HashMap
<>();
final
HashMap
<
String
,
String
>
folders_config
=
new
HashMap
<>();
if
(
configuration
.
containsKey
(
"host_tmpdir"
))
folders_config
.
put
(
"tmpdir"
,
(
String
)
configuration
.
get
(
"host_tmpdir"
));
...
...
@@ -588,17 +588,16 @@ public class ConfigUtils {
if
(
configuration
.
containsKey
(
"site_logdir"
))
folders_config
.
put
(
"logdir"
,
(
String
)
configuration
.
get
(
"site_logdir"
));
for
(
String
folder
:
folders_config
.
keySet
())
{
String
folderpath
=
folders_config
.
get
(
folder
);
for
(
final
String
folder
:
folders_config
.
keySet
())
{
final
String
folderpath
=
folders_config
.
get
(
folder
);
try
{
File
folderf
=
new
File
(
folderpath
);
final
File
folderf
=
new
File
(
folderpath
);
if
(!
folderf
.
exists
())
{
final
boolean
created
=
folderf
.
mkdirs
();
if
(!
created
)
{
if
(!
created
)
logger
.
severe
(
"Directory for "
+
folder
+
"can't be created: "
+
folderpath
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
logger
.
severe
(
"Exception on directory creation: "
+
e
.
toString
());
}
}
...
...
Write
Preview
Supports
Markdown
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