jiapeng 7 years ago
parent
commit
2769cf018e
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/main/java/com/ekexiu/portal/cms/TemplateService.java

+ 7 - 7
src/main/java/com/ekexiu/portal/cms/TemplateService.java

@ -138,7 +138,7 @@ public class TemplateService {
138 138
			}
139 139
		}
140 140
		File parent = dest.getParentFile();
141
		if(!parent.exists()){
141
		if (!parent.exists()) {
142 142
			parent.mkdirs();
143 143
		}
144 144
		Template template = this.cfg.getTemplate(templateName, "UTF-8");
@ -230,8 +230,8 @@ public class TemplateService {
230 230
			Article article = articleDao.queryOne(con, (String) key);
231 231
			if (article == null)
232 232
				return;
233
			String dir = article.getCreateTime().substring(0, 8);
234
			File file = new File(this.dir, dir + "/a/" + article.getShareId() + ".html");
233
			String path = article.getCreateTime().substring(0, 8) + "/";
234
			File file = new File(this.dir, "a/" + path + article.getShareId() + ".html");
235 235
			if (file.exists()) {
236 236
				file.delete();
237 237
			}
@ -251,8 +251,8 @@ public class TemplateService {
251 251
			Ppaper page = this.ppaperDao.query(con, (String) key);
252 252
			if (page == null)
253 253
				return;
254
			String dir = page.getCreateTime().substring(0, 8);
255
			File file = new File(this.dir, dir + "/p/" + page.getShareId() + ".html");
254
			String path = page.getCreateTime().substring(0, 8) + "/";
255
			File file = new File(this.dir, "pp/" + path + page.getShareId() + ".html");
256 256
			if (file.exists()) {
257 257
				file.delete();
258 258
			}
@ -270,8 +270,8 @@ public class TemplateService {
270 270
			Ppatent page = this.ppatentDao.query(con, (String) key);
271 271
			if (page == null)
272 272
				return;
273
			String dir = page.getCreateTime().substring(0, 8);
274
			File file = new File(this.dir, dir + "/p/" + page.getShareId() + ".html");
273
			String path = page.getCreateTime().substring(0, 8) + "/";
274
			File file = new File(this.dir, "pt/" + path + page.getShareId() + ".html");
275 275
			if (file.exists()) {
276 276
				file.delete();
277 277
			}