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
e5b0a28c
Unverified
Commit
e5b0a28c
authored
May 06, 2020
by
Fabien Viale
Committed by
GitHub
May 06, 2020
Browse files
Merge pull request #3752 from fviale/master
SchedulerBackup: handle null value returned by listFiles
parents
b114cd29
ccb8c5c2
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 @
e5b0a28c
...
...
@@ -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 @
e5b0a28c
...
...
@@ -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