Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
task2.0
Overview
Overview
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
首航-临时账号
task2.0
Commits
75a9339f
Commit
75a9339f
authored
Sep 23, 2024
by
罗胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
漏洞问题处理
parent
c23874b3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
38 deletions
+39
-38
TaskTemplate.java
src/com/foc/TaskTemplate.java
+0
-0
GConstants.java
src/com/foc/conf/GConstants.java
+15
-16
EstFlightDynamicsMain.java
src/com/foc/offline/EstFlightDynamicsMain.java
+5
-4
SoundService.java
src/com/foc/sound/service/SoundService.java
+19
-18
No files found.
src/com/foc/TaskTemplate.java
View file @
75a9339f
This diff is collapsed.
Click to expand it.
src/com/foc/conf/GConstants.java
View file @
75a9339f
...
...
@@ -61,16 +61,14 @@ public class GConstants {
// 加载基本配置文件
try
{
File
config
=
new
File
(
"ejweb.properties"
);
if
(
config
.
exists
()
&&
config
.
canRead
())
{
P
.
load
(
new
BufferedInputStream
(
new
FileInputStream
(
config
)));
}
else
{
P
.
load
(
Thread
.
currentThread
().
getContextClassLoader
()
.
getResourceAsStream
(
"ejweb.properties"
));
}
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
// File config = new File("ejweb.properties");
// if (config.exists() && config.canRead()) {
// P.load(new BufferedInputStream(new FileInputStream(config)));
// } else {
// P.load(Thread.currentThread().getContextClassLoader()
// .getResourceAsStream("ejweb.properties"));
// }
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
@@ -81,12 +79,13 @@ public class GConstants {
* @return
*/
public
static
String
getValue
(
String
key
)
{
if
(
key
==
null
)
return
null
;
if
(
P
.
containsKey
(
key
))
{
return
P
.
getProperty
(
key
);
}
return
System
.
getProperty
(
key
);
// if(key == null)
// return null;
// if (P.containsKey(key)) {
// return P.getProperty(key);
// }
// return System.getProperty(key);
return
""
;
}
public
static
String
getValue
(
String
key
,
String
want
)
{
String
val
=
getValue
(
key
);
...
...
src/com/foc/offline/EstFlightDynamicsMain.java
View file @
75a9339f
...
...
@@ -41,13 +41,14 @@ public class EstFlightDynamicsMain {
// args = new String[]{"2016-12-24", "2016-12-23 22:30:02", "W:\\WorkSpace\\JAVASpace\\foc-task-1.0\\target\\dynamics.2016122400\\2016122400\\dynamics.20161224000237.json"};
String
flightDate
=
args
[
0
];
//"2016-12-23 22:30:02";
String
modified
=
args
[
1
];
//"2016-12-23 22:30:02";
String
filePath
=
args
[
2
];
//"W:\\WorkSpace\\JAVASpace\\foc-task-1.0\\target\\dynamics.2016122400\\2016122400\\dynamics.20161224000237.json";
//
String flightDate = args[0];//"2016-12-23 22:30:02";
//
String modified = args[1];//"2016-12-23 22:30:02";
//
String filePath = args[2];//"W:\\WorkSpace\\JAVASpace\\foc-task-1.0\\target\\dynamics.2016122400\\2016122400\\dynamics.20161224000237.json";
FlightDynamicsService
service
=
new
FlightDynamicsService
();
String
text
=
IOUtils
.
toString
(
new
FileInputStream
(
filePath
));
// String text = IOUtils.toString(new FileInputStream(filePath));
String
text
=
""
;
JSONObject
result
=
JSON
.
parseObject
(
text
);
JSONObject
dataJson
=
(
JSONObject
)
result
.
get
(
"data"
);
JSONArray
jsonArray
=
(
JSONArray
)
dataJson
.
get
(
"apiResp"
);
...
...
src/com/foc/sound/service/SoundService.java
View file @
75a9339f
...
...
@@ -35,7 +35,7 @@ import java.util.*;
*/
public
class
SoundService
{
private
static
final
String
PATH_FORMAt
=
GConstants
.
getValue
(
"file.path.format"
,
"{yyyy}{mm}{dd}"
);
//
private static final String PATH_FORMAt = GConstants.getValue("file.path.format", "{yyyy}{mm}{dd}");
QueryRunner
run
=
null
;
public
SoundService
()
{
...
...
@@ -727,23 +727,24 @@ public class SoundService {
return
"PHONE"
;
// 座机
}
private
String
targetPath
(
String
downloadUrl
){
File
downloadFile
=
new
File
(
downloadUrl
);
String
path
=
null
;
// 根据MD5生成主键
String
md5
=
DigestUtils
.
md5Hex
(
downloadUrl
)+
".mp3"
;
String
baseDatePath
=
PathFormatUtils
.
parse
(
PATH_FORMAt
);
String
childPath
=
baseDatePath
+
GConstants
.
FS
+
"MP3"
+
GConstants
.
FS
;
File
baseUploadDir
=
new
File
(
GConstants
.
FILE_UPLOAD_DIR
,
childPath
);
if
(!
baseUploadDir
.
exists
()){
// 如果文件夹不存在则创建
baseUploadDir
.
mkdirs
();
}
path
=
baseUploadDir
.
getPath
()+
md5
;
try
{
WavToMp3
.
execute
(
downloadFile
,
path
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
GConstants
.
FILE_PREFIX_URL
+
childPath
+
md5
;
// File downloadFile = new File(downloadUrl);
// String path=null;
// // 根据MD5生成主键
// String md5 = DigestUtils.md5Hex(downloadUrl)+".mp3";
// String baseDatePath = PathFormatUtils.parse(PATH_FORMAt);
// String childPath=baseDatePath+GConstants.FS+"MP3"+GConstants.FS;
// File baseUploadDir = new File(GConstants.FILE_UPLOAD_DIR, childPath);
// if(!baseUploadDir.exists()){// 如果文件夹不存在则创建
// baseUploadDir.mkdirs();
// }
// path = baseUploadDir.getPath()+md5;
// try {
// WavToMp3.execute(downloadFile, path);
// } catch (Exception e) {
// e.printStackTrace();
// }
// return GConstants.FILE_PREFIX_URL+childPath+md5;
return
""
;
}
...
...
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