if (findContext(name) != null)
{
return "The context could not be created because a context with the same name already exists";
}
FileUtils ant = new FileUtils();
File exploded = new File(deployDir, name);
boolean extr = false;
if ((spr == true) || (internal == false))
{
if (FileUtils.validDeployableJipletDir(exploded
.getAbsolutePath()) == true)
{
if (f.lastModified() > exploded.lastModified())
{
if (JipletLogger.isDebugEnabled() == true)
{
JipletLogger
.info("Found older exploded context entry "
+ exploded.getAbsolutePath()
+ " while creating the context "
+ name + ". Deleting the directory");
}
ant.deleteDir(exploded.getAbsolutePath());
extr = true;
}
}
else
{
if (exploded.isDirectory() == true)
{
ant.deleteDir(exploded.getAbsolutePath());
}
extr = true;
}
}
if (extr == true)
{
if (spr == true)
{
if (ant.extractSpr(f.getAbsolutePath(), deployDir
.getAbsolutePath(), name) == false)
{
JipletLogger.error("Error extracting context " + name
+ " from the corresponding spr file");
return "The zipped context could not be extracted";
}
}
else
// exploded
{
if (ant.copy(path, deployDir.getAbsolutePath()) == false)
{
JipletLogger.error("Error copying exploded context "
+ name + " file: " + path
+ " to deploy directory");
return "The exploded context could not be copied to the deploy dir";