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