Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-04-03 06:30:20 -0400
committerChristopher Frost2012-04-03 06:30:20 -0400
commitcb89a6ee803c9aead5c918689763b8b92e03dcb0 (patch)
tree80837f7ec07403d7b16d84b6ce94a92efdd6d425
parent6180c618f53d56ffb9e28c89ba284cfd69a4941d (diff)
downloadorg.eclipse.virgo.kernel-cb89a6ee803c9aead5c918689763b8b92e03dcb0.tar.gz
org.eclipse.virgo.kernel-cb89a6ee803c9aead5c918689763b8b92e03dcb0.tar.xz
org.eclipse.virgo.kernel-cb89a6ee803c9aead5c918689763b8b92e03dcb0.zip
375043 Fail moving a path reference when it still exists after delition
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
index d67daf38..013746ec 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/install/artifact/internal/StandardArtifactStorage.java
@@ -23,14 +23,11 @@ import org.eclipse.virgo.kernel.artifact.fs.ArtifactFSFactory;
import org.eclipse.virgo.kernel.deployer.core.DeployerLogEvents;
import org.eclipse.virgo.kernel.install.artifact.ArtifactStorage;
import org.eclipse.virgo.medic.eventlog.EventLogger;
+import org.eclipse.virgo.util.io.FatalIOException;
import org.eclipse.virgo.util.io.JarUtils;
import org.eclipse.virgo.util.io.PathReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
final class StandardArtifactStorage implements ArtifactStorage {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(StandardArtifactStorage.class);
private static final List<String> JAR_EXTENSIONS = Arrays.asList("jar", "war", "par", "zip");
@@ -113,8 +110,9 @@ final class StandardArtifactStorage implements ArtifactStorage {
private void stashContent() {
if (this.baseStagingPathReference.exists()) {
- if (!this.pastStagingPathReference.delete(true)) {
- LOGGER.warn(String.format("Unable to delete %s while stashing content", this.pastStagingPathReference.toString()));
+ this.pastStagingPathReference.delete(true);
+ if (this.pastStagingPathReference.exists()) {
+ throw new FatalIOException(String.format("Unable to delete %s while stashing content", this.pastStagingPathReference.toString()));
}
this.baseStagingPathReference.moveTo(this.pastStagingPathReference);
}
@@ -122,8 +120,9 @@ final class StandardArtifactStorage implements ArtifactStorage {
private void unstashContent() {
if (this.pastStagingPathReference.exists()) {
- if (!this.baseStagingPathReference.delete(true)) {
- LOGGER.warn(String.format("Unable to delete %s while unstashing content", this.baseStagingPathReference.toString()));
+ this.baseStagingPathReference.delete(true);
+ if (this.baseStagingPathReference.exists()) {
+ throw new FatalIOException(String.format("Unable to delete %s while unstashing content", this.baseStagingPathReference.toString()));
}
this.pastStagingPathReference.moveTo(this.baseStagingPathReference);
}

Back to the top