Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
0435322a
Commit
0435322a
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
no-jira: don't write the cause exception as a message of the DocumentException
parent
3947c257
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/search/service/document/file/PdfDocument.java
+5
-6
5 additions, 6 deletions
...va/org/olat/search/service/document/file/PdfDocument.java
with
5 additions
and
6 deletions
src/main/java/org/olat/search/service/document/file/PdfDocument.java
+
5
−
6
View file @
0435322a
...
@@ -67,10 +67,10 @@ public class PdfDocument extends FileDocument {
...
@@ -67,10 +67,10 @@ public class PdfDocument extends FileDocument {
}
}
public
static
Document
createDocument
(
SearchResourceContext
leafResourceContext
,
VFSLeaf
leaf
)
throws
IOException
,
DocumentException
,
DocumentAccessException
{
public
static
Document
createDocument
(
SearchResourceContext
leafResourceContext
,
VFSLeaf
leaf
)
throws
IOException
,
DocumentException
,
DocumentAccessException
{
PdfDocument
textDocument
=
new
PdfDocument
();
PdfDocument
textDocument
=
new
PdfDocument
();
textDocument
.
setFilePath
(
getPdfTextTmpFilePath
(
leafResourceContext
));
textDocument
.
setFilePath
(
getPdfTextTmpFilePath
(
leafResourceContext
));
textDocument
.
init
(
leafResourceContext
,
leaf
);
textDocument
.
init
(
leafResourceContext
,
leaf
);
textDocument
.
setFileType
(
FILE_TYPE
);
textDocument
.
setFileType
(
FILE_TYPE
);
textDocument
.
setCssIcon
(
CSSHelper
.
createFiletypeIconCssClassFor
(
leaf
.
getName
()));
textDocument
.
setCssIcon
(
CSSHelper
.
createFiletypeIconCssClassFor
(
leaf
.
getName
()));
if
(
log
.
isDebug
()
)
log
.
debug
(
textDocument
.
toString
());
if
(
log
.
isDebug
()
)
log
.
debug
(
textDocument
.
toString
());
return
textDocument
.
getLuceneDocument
();
return
textDocument
.
getLuceneDocument
();
...
@@ -98,7 +98,6 @@ public class PdfDocument extends FileDocument {
...
@@ -98,7 +98,6 @@ public class PdfDocument extends FileDocument {
try
{
try
{
String
bean
=
externalIndexer
?
"pdfExternalIndexer"
:
"pdfInternalIndexer"
;
String
bean
=
externalIndexer
?
"pdfExternalIndexer"
:
"pdfInternalIndexer"
;
PdfExtractor
extractor
=
(
PdfExtractor
)
CoreSpringFactory
.
getBean
(
bean
);
PdfExtractor
extractor
=
(
PdfExtractor
)
CoreSpringFactory
.
getBean
(
bean
);
File
pdfTextFile
=
new
File
(
pdfTextBufferPath
,
getFilePath
()
+
".tmp"
);
File
pdfTextFile
=
new
File
(
pdfTextBufferPath
,
getFilePath
()
+
".tmp"
);
if
(
isNewPdfFile
(
leaf
,
pdfTextFile
))
{
if
(
isNewPdfFile
(
leaf
,
pdfTextFile
))
{
//prepare dirs
//prepare dirs
...
@@ -114,7 +113,7 @@ public class PdfDocument extends FileDocument {
...
@@ -114,7 +113,7 @@ public class PdfDocument extends FileDocument {
// pass exception
// pass exception
throw
ex
;
throw
ex
;
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
throw
new
DocumentException
(
"Can not read PDF content. File="
+
leaf
.
getName
()
+
";"
+
ex
.
getMessage
()
);
throw
new
DocumentException
(
"Can not read PDF content. File="
+
leaf
.
getName
()
,
ex
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment