Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
00e4df5e
Commit
00e4df5e
authored
Dec 21, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
32c90bb5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+2
-7
CheckFileHeaderUtil.java
src/main/java/org/rcisoft/core/util/CheckFileHeaderUtil.java
+2
-2
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
00e4df5e
...
@@ -651,7 +651,6 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -651,7 +651,6 @@ public class BChapterServiceImpl implements BChapterService {
@Override
@Override
public
String
checkFileHeader
(
BFile
bFile
)
{
public
String
checkFileHeader
(
BFile
bFile
)
{
String
flag
=
"1"
;
String
name
=
bFile
.
getVideoUrl
().
substring
(
bFile
.
getVideoUrl
().
lastIndexOf
(
"/"
)
+
1
);
String
name
=
bFile
.
getVideoUrl
().
substring
(
bFile
.
getVideoUrl
().
lastIndexOf
(
"/"
)
+
1
);
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
"temp"
;
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
"temp"
;
File
file
=
new
File
(
filePath
);
File
file
=
new
File
(
filePath
);
...
@@ -667,14 +666,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -667,14 +666,10 @@ public class BChapterServiceImpl implements BChapterService {
if
(!
line
){
if
(!
line
){
throw
new
ServiceException
(
ResultServiceEnums
.
FILE_UNREADABLE
);
throw
new
ServiceException
(
ResultServiceEnums
.
FILE_UNREADABLE
);
}
}
LogUtil
.
fileChangeLog
(
"-----------------------后缀名相符-------------------------"
+
fileOld
);
}
}
return
flag
;
return
"1"
;
// Boolean line = CheckFileHeaderUtil.toCheck(getDownLoadUrl(bFile));
// if (!line) {
// throw new ServiceException(ResultServiceEnums.FILE_CHECK_ERROR);
// }
// return "1";
}
}
...
...
src/main/java/org/rcisoft/core/util/CheckFileHeaderUtil.java
View file @
00e4df5e
...
@@ -6,7 +6,7 @@ import java.io.FileInputStream;
...
@@ -6,7 +6,7 @@ import java.io.FileInputStream;
@Slf4j
@Slf4j
public
class
CheckFileHeaderUtil
{
public
class
CheckFileHeaderUtil
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
filePath
=
"
C:\\Users\\Administrator\\Desktop\\003
.mp4"
;
String
filePath
=
"
D:\\recorded\\Python\\1.68
.mp4"
;
System
.
out
.
println
(
toCheck
(
filePath
));
System
.
out
.
println
(
toCheck
(
filePath
));
}
}
...
@@ -72,7 +72,7 @@ public class CheckFileHeaderUtil {
...
@@ -72,7 +72,7 @@ public class CheckFileHeaderUtil {
if
(
type
.
contains
(
"89504E470D0A1A0A"
))
if
(
type
.
contains
(
"89504E470D0A1A0A"
))
return
"png"
;
return
"png"
;
if
(
type
.
contains
(
"0000002066747
"
))
if
(
type
.
substring
(
0
,
10
).
contains
(
"000000
"
))
return
"mp4"
;
return
"mp4"
;
if
(
type
.
contains
(
"4944330300000"
))
if
(
type
.
contains
(
"4944330300000"
))
...
...
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