Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ProActive
scheduling
Commits
ccb8c5c2
Commit
ccb8c5c2
authored
May 05, 2020
by
Fabien Viale
Browse files
SchedulerBackup: handle null value returned by listFiles
additionally, improve logging
parent
3f89eab2
Changes
2
Hide whitespace changes
Inline
Side-by-side
scheduler/scheduler-api/src/main/java/org/ow2/proactive/scheduler/common/util/ZipUtils.java
View file @
ccb8c5c2
...
...
@@ -145,12 +145,16 @@ public class ZipUtils extends FileUtils {
if
(
dirobject
.
isDirectory
())
{
File
[]
fileList
=
dirobject
.
listFiles
();
// Loop through the files
for
(
int
i
=
0
;
i
<
fileList
.
length
;
i
++)
{
if
(
fileList
[
i
].
isDirectory
())
{
zipDirectory
(
fileList
[
i
].
getPath
(),
iBaseFolderLength
,
zos
,
crc
);
}
else
if
(
fileList
[
i
].
isFile
())
{
zipFile
(
fileList
[
i
].
getPath
(),
iBaseFolderLength
,
zos
,
crc
);
if
(
fileList
!=
null
)
{
for
(
int
i
=
0
;
i
<
fileList
.
length
;
i
++)
{
if
(
fileList
[
i
].
isDirectory
())
{
zipDirectory
(
fileList
[
i
].
getPath
(),
iBaseFolderLength
,
zos
,
crc
);
}
else
if
(
fileList
[
i
].
isFile
())
{
zipFile
(
fileList
[
i
].
getPath
(),
iBaseFolderLength
,
zos
,
crc
);
}
}
}
else
{
logger
.
warn
(
"Problem accessing folder: "
+
dirobject
);
}
}
else
{
throw
new
IOException
(
directoryName
+
" is not a directory."
);
...
...
scheduler/scheduler-server/src/main/java/org/ow2/proactive/scheduler/core/SchedulerBackupRunner.java
View file @
ccb8c5c2
...
...
@@ -128,7 +128,12 @@ public class SchedulerBackupRunner implements Runnable {
.
map
(
target
->
(
new
File
(
PASchedulerProperties
.
SCHEDULER_HOME
.
getValueAsString
(),
target
)).
getAbsolutePath
())
.
toArray
(
String
[]::
new
);
ZipUtils
.
zip
(
foldersToZip
,
backupFile
,
null
);
LOGGER
.
info
(
"Backup of the following folders : "
+
Arrays
.
toString
(
foldersToZip
));
try
{
ZipUtils
.
zip
(
foldersToZip
,
backupFile
,
null
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"Error when performing backup"
,
e
);
}
}
else
{
LOGGER
.
error
(
"Cannot save a backup because backup configuredDestination folder does not exist: "
+
configuredDestination
);
...
...
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