|
|
@@ -51,6 +51,7 @@ public class WordImportService extends BaseTransaction {
|
|
|
File htmlFile = new File(targetDir, htmlFileName);
|
|
|
String htmlContent = normalizeHtml(htmlFile, targetRelativePath);
|
|
|
FileUtil.writeFile(htmlContent, htmlFile.getAbsolutePath());
|
|
|
+ ensureConvertedFilesReadable(targetDir);
|
|
|
|
|
|
result.put("code", "success");
|
|
|
result.put("msg", "转换成功");
|
|
|
@@ -77,4 +78,18 @@ public class WordImportService extends BaseTransaction {
|
|
|
}
|
|
|
return document.select("body").eq(0).html();
|
|
|
}
|
|
|
+
|
|
|
+ private void ensureConvertedFilesReadable(File targetDir) {
|
|
|
+ targetDir.setReadable(true, false);
|
|
|
+ targetDir.setExecutable(true, false);
|
|
|
+ File[] files = targetDir.listFiles();
|
|
|
+ if (files == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (File file : files) {
|
|
|
+ if (file.isFile()) {
|
|
|
+ file.setReadable(true, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|