mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-09 02:54:20 +00:00
Removed deprecated search.dir-property; added null check for directory properties
This commit is contained in:
@@ -43,18 +43,15 @@ public class InfoCheck extends Check {
|
|||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
|
|
||||||
DSBitStoreService localStore = new DSpace().getServiceManager().getServicesByType(DSBitStoreService.class).get(0);
|
DSBitStoreService localStore = new DSpace().getServiceManager().getServicesByType(DSBitStoreService.class).get(0);
|
||||||
|
|
||||||
for (String[] ss : new String[][] {
|
for (String[] ss : new String[][] {
|
||||||
new String[] {
|
new String[] {
|
||||||
localStore.getBaseDir().toString(),
|
localStore.getBaseDir().toString(),
|
||||||
"Assetstore size", },
|
"Assetstore size", },
|
||||||
new String[] {
|
|
||||||
configurationService.getProperty("search.dir"),
|
|
||||||
"Search dir size", },
|
|
||||||
new String[] {
|
new String[] {
|
||||||
configurationService.getProperty("log.report.dir"),
|
configurationService.getProperty("log.report.dir"),
|
||||||
"Log dir size", }, })
|
"Log dir size", }, })
|
||||||
{
|
{
|
||||||
|
if (ss[0] != null) {
|
||||||
try {
|
try {
|
||||||
File dir = new File(ss[0]);
|
File dir = new File(ss[0]);
|
||||||
if (dir.exists()) {
|
if (dir.exists()) {
|
||||||
@@ -69,6 +66,10 @@ public class InfoCheck extends Check {
|
|||||||
error(e, "directory - " + ss[0]);
|
error(e, "directory - " + ss[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else { // cannot read property for some reason
|
||||||
|
sb.append(String.format("Could not get information for %s!\n", ss[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user