if(!fileFolder.exists()){
fileFolder.mkdirs();
}
java.io.File file = null;
FolderAPI fapi = APILocator.getFolderAPI();
UserAPI uapi = APILocator.getUserAPI();
String menuId = "";
if (path.equals("/")) {
fileName = hostId + "_static.vtl";
menuId = String.valueOf(hostId);
file = new java.io.File(StaticMenuBuilder.MENU_VTL_PATH + java.io.File.separator + fileName);
if (!file.exists()) {
Host host = APILocator.getHostAPI().find(hostId, APILocator.getUserAPI().getSystemUser(),false);
itemsList = fapi.findSubFolders(host, true);
folderPath = path;
fileExists = false;
}
}
else {
Folder folder = fapi.findFolderByPath(path,hostId,uapi.getSystemUser(),false);
Logger.debug(StaticMenuBuilder.class, "StaticMenuBuilder folder=" + APILocator.getIdentifierAPI().find(folder).getPath());
fileName = folder.getInode() + "_static.vtl";
menuId = String.valueOf(folder.getInode());
file = new java.io.File(StaticMenuBuilder.MENU_VTL_PATH + java.io.File.separator + fileName);
if (!file.exists()) {
itemsList = fapi.findMenuItems(folder,uapi.getSystemUser(),false);
folderPath = APILocator.getIdentifierAPI().find(folder).getPath();
fileExists = false;
}
}
String filePath = "dynamic" + java.io.File.separator + "menus" + java.io.File.separator + fileName;