Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2011-10-25 11:26:05 -0400
committerChristopher Frost2011-10-25 11:26:05 -0400
commitb106d8485ce82a3ae288c14277fce7236816f5ab (patch)
tree4fd157c51d372ac7c39faf8374669ca3cc68c326
parent149985f8d9971016cbf4f47b9011b616877ca1d1 (diff)
downloadorg.eclipse.virgo.medic-b106d8485ce82a3ae288c14277fce7236816f5ab.tar.gz
org.eclipse.virgo.medic-b106d8485ce82a3ae288c14277fce7236816f5ab.tar.xz
org.eclipse.virgo.medic-b106d8485ce82a3ae288c14277fce7236816f5ab.zip
360646 Adding a slight change to the MBean api
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java7
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java9
2 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
index d21947a..e424a79 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/DumpInspector.java
@@ -24,6 +24,13 @@ import javax.management.MXBean;
public interface DumpInspector {
/**
+ * Return the currently configured dump directory
+ *
+ * @return
+ */
+ String getConfiguredDumpDirectory();
+
+ /**
* An array of the available dump ids
*
* @return array of dump ids
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
index 4ae85c5..89ca314 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java
@@ -49,6 +49,11 @@ public class FileSystemDumpInspector implements DumpInspector {
}
@Override
+ public String getConfiguredDumpDirectory() {
+ return configurationProvider.getConfiguration().get(ConfigurationProvider.KEY_DUMP_ROOT_DIRECTORY);
+ }
+
+ @Override
public String[] getDumps() throws IOException {
File dumpDir = getDumpDirectory();
if(dumpDir != null && dumpDir.exists() && dumpDir.isDirectory()){
@@ -114,7 +119,7 @@ public class FileSystemDumpInspector implements DumpInspector {
} catch (IOException e1) {
// no-op to close stream
}
- // no-op just return the default null value and let the js deal with it
+ // no-op just return the default empty value and let the js deal with it
}
}
}
@@ -129,7 +134,7 @@ public class FileSystemDumpInspector implements DumpInspector {
@Override
public void delete(String dumpId) {
File dumpDir = getDumpDirectory();
- if(dumpDir.exists() && dumpDir.isDirectory()){
+ if(dumpDir != null && dumpDir.exists() && dumpDir.isDirectory()){
File root = new File(dumpDir, dumpId);
if(root.exists() && root.isDirectory()){
FileSystemUtils.deleteRecursively(root);

Back to the top