Methods Summary |
---|
public void | deployedEntity(java.io.File autodeployDir, java.io.File deployedEntity)
try {
AutoDeployedFilesManager adfm = AutoDeployedFilesManager.loadStatus(autodeployDir);
adfm.setDeployedFileInfo(deployedEntity);
adfm.writeStatus();
} catch (Exception e) {
printException(e);
// Do nothing
}
|
public java.io.File[] | getAllDeployableModules(java.io.File autodeployDir, boolean includeSubDir)Get the list of all deployable files
AutoDeployedFilesManager adfm = null;
try {
adfm = AutoDeployedFilesManager.loadStatus(autodeployDir);
} catch (Exception e) {
printException(e);
return new File[0];
}
return adfm.getFilesForDeployment(getListOfFiles(autodeployDir, includeSubDir));
|
public java.io.File[] | getAllFilesForUndeployment(java.io.File autodeployDir)
try {
AutoDeployedFilesManager adfm = AutoDeployedFilesManager.loadStatus(autodeployDir);
return adfm.getFilesForUndeployment(getListOfFiles(autodeployDir, true));
} catch (Exception e) {
printException(e);
return new File[0];
}
|
protected java.io.File[] | getListOfFiles(java.io.File dir)
return getListOfFiles(dir, false);
|
protected java.io.File[] | getListOfFiles(java.io.File dir, boolean includeSubDir)
return getListOfFilesAsSet(dir, includeSubDir).toArray(new File[0]);
|
static java.util.Set | getListOfFilesAsSet(java.io.File dir, boolean includeSubDir)
Set<File> result = new HashSet<File>();
File[] dirFiles = dir.listFiles();
for (File dirFile : dirFiles) {
String name = dirFile.getName();
String fileType = name.substring(name.lastIndexOf(".") + 1);
if (fileType != null && !fileType.equals("") &&
(fileType.equals(AutoDeployConstants.EAR_EXTENSION) ||
fileType.equals(AutoDeployConstants.WAR_EXTENSION) ||
fileType.equals(AutoDeployConstants.JAR_EXTENSION) ||
fileType.equals(AutoDeployConstants.RAR_EXTENSION))) {
result.add(dirFile);
continue;
}
if (dirFile.isDirectory()) {
if (includeSubDir && !(dirFile.getName().equals(".autodeploystatus"))) {
result.addAll(getListOfFilesAsSet(dirFile, true));
}
} else {
if(fileType != null && !fileType.equals("") &&
(fileType.equals(AutoDeployConstants.ZIP_EXTENSION) ||
fileType.equals("class"))) {
result.add(dirFile);
}
}
}
return result;
|
public boolean | hasNewDeployableEntity(java.io.File autodeployDir)return true if any new deployable entity is present in autodeployDir
boolean newFilesExist=false;
try {
AutoDeployedFilesManager adfm = AutoDeployedFilesManager.loadStatus(autodeployDir);
if(adfm.getFilesForDeployment(getListOfFiles(autodeployDir)).length > 0) {
//atleast one new file is there
newFilesExist=true;
}
} catch (Exception e) {
printException(e);
return false;
}
return newFilesExist;
|
protected void | printException(java.lang.Exception e)
sLogger.log(Level.SEVERE, e.getMessage(), e);
e.printStackTrace();
|
public void | undeployedEntity(java.io.File autodeployDir, java.io.File undeployedEntity)
try {
AutoDeployedFilesManager adfm = AutoDeployedFilesManager.loadStatus(autodeployDir);
adfm.deleteDeployedFileInfo(undeployedEntity);
adfm.writeStatus();
} catch (Exception e) {
printException(e);
// Do nothing
}
|