Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁杰芳
slm-fileview
Commits
f989fbf9
Commit
f989fbf9
authored
Apr 18, 2019
by
陈精华
Committed by
kl
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优先使用自定义office.home
parent
af8ddc10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
OfficeUtils.java
...ava/org/artofsolving/jodconverter/office/OfficeUtils.java
+18
-2
ConfigRefreshComponent.java
...rc/main/java/cn/keking/config/ConfigRefreshComponent.java
+1
-3
No files found.
jodconverter-core/src/main/java/org/artofsolving/jodconverter/office/OfficeUtils.java
View file @
f989fbf9
...
@@ -12,8 +12,11 @@
...
@@ -12,8 +12,11 @@
//
//
package
org
.
artofsolving
.
jodconverter
.
office
;
package
org
.
artofsolving
.
jodconverter
.
office
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
org.artofsolving.jodconverter.util.PlatformUtils
;
import
org.artofsolving.jodconverter.util.PlatformUtils
;
...
@@ -61,8 +64,14 @@ public class OfficeUtils {
...
@@ -61,8 +64,14 @@ public class OfficeUtils {
}
}
public
static
File
getDefaultOfficeHome
()
{
public
static
File
getDefaultOfficeHome
()
{
if
(
System
.
getProperty
(
"office.home"
)
!=
null
)
{
Properties
properties
=
new
Properties
();
return
new
File
(
System
.
getProperty
(
"office.home"
));
String
customizedConfigPath
=
getCustomizedConfigPath
();
try
{
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
FileReader
(
customizedConfigPath
));
properties
.
load
(
bufferedReader
);
}
catch
(
Exception
e
)
{}
if
(
properties
.
getProperty
(
"office.home"
)
!=
null
)
{
return
new
File
(
properties
.
getProperty
(
"office.home"
));
}
}
if
(
PlatformUtils
.
isWindows
())
{
if
(
PlatformUtils
.
isWindows
())
{
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
// %ProgramFiles(x86)% on 64-bit machines; %ProgramFiles% on 32-bit ones
...
@@ -127,4 +136,11 @@ public class OfficeUtils {
...
@@ -127,4 +136,11 @@ public class OfficeUtils {
return
userDir
;
return
userDir
;
}
}
public
static
String
getCustomizedConfigPath
()
{
String
homePath
=
OfficeUtils
.
getHomePath
();
String
separator
=
java
.
io
.
File
.
separator
;
String
configFilePath
=
homePath
+
separator
+
"conf"
+
separator
+
"application.properties"
;
return
configFilePath
;
}
}
}
jodconverter-web/src/main/java/cn/keking/config/ConfigRefreshComponent.java
View file @
f989fbf9
...
@@ -42,9 +42,7 @@ public class ConfigRefreshComponent {
...
@@ -42,9 +42,7 @@ public class ConfigRefreshComponent {
String
convertedFileCharset
=
sysProperties
.
getProperty
(
"sun.jnu.encoding"
);
String
convertedFileCharset
=
sysProperties
.
getProperty
(
"sun.jnu.encoding"
);
String
[]
textArray
;
String
[]
textArray
;
String
[]
mediaArray
;
String
[]
mediaArray
;
String
homePath
=
OfficeUtils
.
getHomePath
();
String
configFilePath
=
OfficeUtils
.
getCustomizedConfigPath
();
String
separator
=
java
.
io
.
File
.
separator
;
String
configFilePath
=
homePath
+
separator
+
"conf"
+
separator
+
"application.properties"
;
while
(
true
)
{
while
(
true
)
{
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
FileReader
(
configFilePath
));
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
FileReader
(
configFilePath
));
properties
.
load
(
bufferedReader
);
properties
.
load
(
bufferedReader
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment