update some codestyle
This commit is contained in:
@ -258,9 +258,9 @@
|
|||||||
<classifier>windows-x86_64</classifier>
|
<classifier>windows-x86_64</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.itextpdf</groupId>
|
<groupId>com.itextpdf</groupId>
|
||||||
<artifactId>itextpdf</artifactId>
|
<artifactId>itextpdf</artifactId>
|
||||||
<version>${itextpdf.version}</version>
|
<version>${itextpdf.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public class ConfigConstants {
|
|||||||
public static final String DEFAULT_PROHIBIT = "exe,dll";
|
public static final String DEFAULT_PROHIBIT = "exe,dll";
|
||||||
public static final String DEFAULT_PASSWORD = "123456";
|
public static final String DEFAULT_PASSWORD = "123456";
|
||||||
public static final String DEFAULT_PDF2_JPG_DPI = "105";
|
public static final String DEFAULT_PDF2_JPG_DPI = "105";
|
||||||
public static final String DEFAULT_OFFICE_TyPEWEB_DISABLE = "web";
|
public static final String DEFAULT_OFFICE_TYPE_WEB = "web";
|
||||||
public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
|
public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
|
||||||
|
|
||||||
public static Boolean isCacheEnabled() {
|
public static Boolean isCacheEnabled() {
|
||||||
@ -424,14 +424,14 @@ public class ConfigConstants {
|
|||||||
ConfigConstants.pdf2JpgDpi = pdf2JpgDpi;
|
ConfigConstants.pdf2JpgDpi = pdf2JpgDpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getofficeTypeWeb() {
|
public static String getOfficeTypeWeb() {
|
||||||
return officeTypeWeb;
|
return officeTypeWeb;
|
||||||
}
|
}
|
||||||
@Value("${office.type.web:web}")
|
@Value("${office.type.web:web}")
|
||||||
public void setofficeTypeWeb(String officeTypeWeb) {
|
public void setOfficeTypeWeb(String officeTypeWeb) {
|
||||||
setofficeTypeWebValue(officeTypeWeb);
|
setOfficeTypeWebValue(officeTypeWeb);
|
||||||
}
|
}
|
||||||
public static void setofficeTypeWebValue(String officeTypeWeb) {
|
public static void setOfficeTypeWebValue(String officeTypeWeb) {
|
||||||
ConfigConstants.officeTypeWeb = officeTypeWeb;
|
ConfigConstants.officeTypeWeb = officeTypeWeb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class ConfigRefreshComponent {
|
|||||||
prohibit = properties.getProperty("prohibit", ConfigConstants.DEFAULT_PROHIBIT);
|
prohibit = properties.getProperty("prohibit", ConfigConstants.DEFAULT_PROHIBIT);
|
||||||
password = properties.getProperty("delete.password", ConfigConstants.DEFAULT_PASSWORD);
|
password = properties.getProperty("delete.password", ConfigConstants.DEFAULT_PASSWORD);
|
||||||
pdf2JpgDpi = Integer.parseInt(properties.getProperty("pdf2jpg.dpi", ConfigConstants.DEFAULT_PDF2_JPG_DPI));
|
pdf2JpgDpi = Integer.parseInt(properties.getProperty("pdf2jpg.dpi", ConfigConstants.DEFAULT_PDF2_JPG_DPI));
|
||||||
officeTypeWeb = properties.getProperty("office.type.web", ConfigConstants.DEFAULT_OFFICE_TyPEWEB_DISABLE);
|
officeTypeWeb = properties.getProperty("office.type.web", ConfigConstants.DEFAULT_OFFICE_TYPE_WEB);
|
||||||
deleteSourceFile = Boolean.parseBoolean(properties.getProperty("delete.source.file", ConfigConstants.DEFAULT_DELETE_SOURCE_FILE));
|
deleteSourceFile = Boolean.parseBoolean(properties.getProperty("delete.source.file", ConfigConstants.DEFAULT_DELETE_SOURCE_FILE));
|
||||||
prohibitArray = prohibit.split(",");
|
prohibitArray = prohibit.split(",");
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ public class ConfigRefreshComponent {
|
|||||||
ConfigConstants.setProhibitValue(prohibitArray);
|
ConfigConstants.setProhibitValue(prohibitArray);
|
||||||
ConfigConstants.setPasswordValue(password);
|
ConfigConstants.setPasswordValue(password);
|
||||||
ConfigConstants.setPdf2JpgDpiValue(pdf2JpgDpi);
|
ConfigConstants.setPdf2JpgDpiValue(pdf2JpgDpi);
|
||||||
ConfigConstants.setofficeTypeWebValue(officeTypeWeb);
|
ConfigConstants.setOfficeTypeWebValue(officeTypeWeb);
|
||||||
ConfigConstants.setDeleteSourceFileValue(deleteSourceFile);
|
ConfigConstants.setDeleteSourceFileValue(deleteSourceFile);
|
||||||
setWatermarkConfig(properties);
|
setWatermarkConfig(properties);
|
||||||
bufferedReader.close();
|
bufferedReader.close();
|
||||||
|
|||||||
@ -57,9 +57,9 @@ public class OfficeFilePreviewImpl implements FilePreview {
|
|||||||
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") ) + suffix +"." +(isHtml ? "html" : "pdf"); //生成文件添加类型后缀 防止同名文件
|
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") ) + suffix +"." +(isHtml ? "html" : "pdf"); //生成文件添加类型后缀 防止同名文件
|
||||||
String cacheFileName = userToken == null ? pdfName : userToken + "_" + pdfName;
|
String cacheFileName = userToken == null ? pdfName : userToken + "_" + pdfName;
|
||||||
String outFilePath = FILE_DIR + cacheFileName;
|
String outFilePath = FILE_DIR + cacheFileName;
|
||||||
if(!officePreviewType.equalsIgnoreCase("html")){
|
if (!officePreviewType.equalsIgnoreCase("html")) {
|
||||||
if(officePreviewType.equalsIgnoreCase("web")|| ConfigConstants.getofficeTypeWeb() .equalsIgnoreCase("web") ){
|
if (ConfigConstants.getOfficeTypeWeb() .equalsIgnoreCase("web")) {
|
||||||
if(suffix.equalsIgnoreCase("xlsx")){
|
if (suffix.equalsIgnoreCase("xlsx")) {
|
||||||
model.addAttribute("pdfUrl", url);
|
model.addAttribute("pdfUrl", url);
|
||||||
return XLSX_FILE_PREVIEW_PAGE;
|
return XLSX_FILE_PREVIEW_PAGE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user