Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
3611269e
Commit
3611269e
authored
3 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Add streamCheck function with CityGmlZipEntry
parent
988e20e4
master
dev
dev_gui_features_zip_loading
3.17.0
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
+5
-0
...va/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+31
-0
...main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
with
36 additions
and
0 deletions
+36
-0
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/parser/CityGmlParser.java
+
5
-
0
View file @
3611269e
...
...
@@ -292,6 +292,11 @@ public class CityGmlParser {
}
public
static
void
streamCityGml
(
CityGmlZipInputStream
cgis
,
ParserConfiguration
config
,
CityGmlConsumer
cityObjectConsumer
,
String
outputFile
)
throws
CityGmlParseException
{
return
;
}
public
static
void
streamCityGml
(
String
file
,
ParserConfiguration
config
,
CityGmlConsumer
cityObjectConsumer
,
String
outputFile
)
throws
CityGmlParseException
{
Path
f
=
Paths
.
get
(
file
);
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+
31
-
0
View file @
3611269e
...
...
@@ -48,6 +48,8 @@ import javax.xml.transform.dom.DOMSource;
import
javax.xml.transform.sax.SAXResult
;
import
javax.xml.transform.stream.StreamSource
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipInputStream
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -740,6 +742,35 @@ public class Checker {
return
hasUnusedDependency
;
}
public
static
void
streamCheck
(
CityGmlZipEntry
entry
,
String
xmlOutput
,
String
pdfOutput
,
ValidationConfiguration
config
,
String
outputFile
)
throws
IOException
,
CityGmlParseException
{
try
(
BufferedOutputStream
xmlBos
=
getXmlOutputMaybe
(
xmlOutput
);
BufferedOutputStream
pdfBos
=
getPdfOutputMaybe
(
pdfOutput
))
{
Checker
c
=
new
Checker
(
config
,
null
);
String
fileName
=
entry
.
getFileName
();
// create reporter if available
XmlStreamReporter
xmlReporter
=
getXmlReporter
(
config
,
xmlBos
,
fileName
);
PdfStreamReporter
pdfReporter
=
getPdfReporter
(
config
,
pdfBos
,
fileName
);
// execute schematron first
try
(
CityGmlZipInputStream
cgis
=
new
CityGmlZipInputStream
(
entry
))
{
SvrlContentHandler
handler
=
executeSchematronValidationIfAvailable
(
config
,
cgis
.
getInputStream
());
CityGmlConsumer
con
=
new
StreamCityGmlConsumer
(
c
,
xmlReporter
,
pdfReporter
,
handler
,
config
,
null
);
// parse and validate
CityGmlParser
.
streamCityGml
(
cgis
,
config
.
getParserConfiguration
(),
con
,
outputFile
);
// write reports if available
writeReport
(
xmlReporter
);
writeReport
(
pdfReporter
);
}
}
catch
(
CheckReportWriteException
e
)
{
logger
.
error
(
Localization
.
getText
(
"Checker.failReports"
),
e
);
}
}
public
static
void
streamCheck
(
File
inputFile
,
String
xmlOutput
,
String
pdfOutput
,
ValidationConfiguration
config
,
String
outputFile
)
throws
IOException
,
CityGmlParseException
{
streamCheck
(
inputFile
,
xmlOutput
,
pdfOutput
,
config
,
null
,
outputFile
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets