else
{
return "The realm could not be created because the path does not have a valid signature";
}
FileUtils ant = new FileUtils();
File exploded = new File(deployDir, name);
boolean extr = false;
if (srr)
{
if (FileUtils.validDeployableRealmDir(exploded
.getAbsolutePath()))
{
if (f.lastModified() > exploded.lastModified())
{
if (JipletLogger.isDebugEnabled())
{
JipletLogger
.info("Found older exploded realm entry "
+ exploded.getAbsolutePath()
+ " while creating the realm on directory "
+ name + ". Deleting the directory");
}
ant.deleteDir(exploded.getAbsolutePath());
extr = true;
}
}
else
{
if (exploded.isDirectory())
{
ant.deleteDir(exploded.getAbsolutePath());
}
extr = true;
}
}
// new code
boolean internal = deployDirExists(deployDir, path);
if (srr || !internal)
{
if (FileUtils.validDeployableRealmDir(exploded
.getAbsolutePath()))
{
if (f.lastModified() > exploded.lastModified())
{
if (JipletLogger.isDebugEnabled())
{
JipletLogger
.info("Found older exploded context entry "
+ exploded.getAbsolutePath()
+ " while creating the realm "
+ name + ". Deleting the directory");
}
ant.deleteDir(exploded.getAbsolutePath());
extr = true;
}
}
else
{
if (exploded.isDirectory())
{
ant.deleteDir(exploded.getAbsolutePath());
}
extr = true;
}
}
// new code ends
if (extr)
{
if (srr)
{
if (!ant.extractSpr(f.getAbsolutePath(), deployDir
.getAbsolutePath(), name))
{
JipletLogger
.error("Error extracting realm with directory "
+ name
+ " from the corresponding srr file");
return "The zipped context could not be extracted";
}
}
else
// exploded
{
if (!ant.copy(path, deployDir.getAbsolutePath()))
{
JipletLogger.error("Error copying exploded realm "
+ name + " file: " + path
+ " to deploy directory");
return "The exploded realm could not be copied to the deploy dir";