Beispiel #1
0
 public static void removePageFile(HTMLPage htmlPage, Identifier identifier, boolean EDIT_MODE) {
   String folderPath =
       (!EDIT_MODE) ? "live" + java.io.File.separator : "working" + java.io.File.separator;
   String velocityRootPath = Config.getStringProperty("VELOCITY_ROOT");
   if (velocityRootPath.startsWith("/WEB-INF")) {
     velocityRootPath = com.liferay.util.FileUtil.getRealPath(velocityRootPath);
   }
   String filePath =
       folderPath
           + identifier.getInode()
           + "."
           + Config.getStringProperty("VELOCITY_HTMLPAGE_EXTENSION");
   velocityRootPath += java.io.File.separator;
   java.io.File f = new java.io.File(velocityRootPath + filePath);
   f.delete();
   DotResourceCache vc = CacheLocator.getVeloctyResourceCache();
   vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath);
   CacheLocator.getHTMLPageCache().remove((HTMLPage) htmlPage);
 }