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
287b5edf
Commit
287b5edf
authored
3 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Reformat: Add listener support to ZipEntry stream check
parent
671c277b
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
Pipeline
#10526
failed with stage
in 3 minutes and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+6
-2
...main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
+7
-2
.../java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
with
13 additions
and
4 deletions
+13
-4
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
+
6
-
2
View file @
287b5edf
...
...
@@ -741,6 +741,11 @@ public class Checker {
public
static
void
streamCheck
(
CityGmlZipEntry
entry
,
String
xmlOutput
,
String
pdfOutput
,
ValidationConfiguration
config
,
String
outputFile
)
throws
IOException
,
CityGmlParseException
{
streamCheck
(
entry
,
xmlOutput
,
pdfOutput
,
config
,
null
,
outputFile
);
}
public
static
void
streamCheck
(
CityGmlZipEntry
entry
,
String
xmlOutput
,
String
pdfOutput
,
ValidationConfiguration
config
,
FeatureCheckedListener
l
,
String
outputFile
)
throws
IOException
,
CityGmlParseException
{
try
(
BufferedOutputStream
xmlBos
=
getXmlOutputMaybe
(
xmlOutput
);
BufferedOutputStream
pdfBos
=
getPdfOutputMaybe
(
pdfOutput
))
{
Checker
c
=
new
Checker
(
config
,
null
);
...
...
@@ -754,7 +759,7 @@ public class Checker {
try
(
CityGmlZipEntryFile
entryFile
=
new
CityGmlZipEntryFile
(
entry
))
{
SvrlContentHandler
handler
=
executeSchematronValidationIfAvailable
(
config
,
entryFile
.
getInputStream
());
CityGmlConsumer
con
=
new
StreamCityGmlConsumer
(
c
,
xmlReporter
,
pdfReporter
,
handler
,
config
,
nul
l
);
CityGmlConsumer
con
=
new
StreamCityGmlConsumer
(
c
,
xmlReporter
,
pdfReporter
,
handler
,
config
,
l
);
// parse and validate
CityGmlParser
.
streamCityGml
(
entry
,
config
.
getParserConfiguration
(),
con
,
outputFile
);
...
...
@@ -767,7 +772,6 @@ public class Checker {
}
}
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.
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
+
7
-
2
View file @
287b5edf
...
...
@@ -19,6 +19,7 @@
package
de.hft.stuttgart.citydoctor2.check
;
import
de.hft.stuttgart.citydoctor2.CityDoctorValidation
;
import
de.hft.stuttgart.citydoctor2.checks.util.FeatureCheckedListener
;
import
de.hft.stuttgart.citydoctor2.datastructure.Building
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel
;
import
de.hft.stuttgart.citydoctor2.exceptions.CityDoctorWriteException
;
...
...
@@ -117,14 +118,18 @@ public class CheckerTest {
}
@Test
public
void
testZipEntryChecking
()
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
,
CityDoctorWriteException
{
public
void
testZipEntryChecking
()
throws
CityGmlParseException
,
IOException
{
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
"src/test/resources/zipArchive.zip"
);
assertNotNull
(
cgmlArch
);
cgmlArch
.
mountArchive
(
new
ParserConfiguration
(
8
,
false
));
ValidationConfiguration
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
FeatureCheckedListener
l
=
co
->
{
assertTrue
(
co
.
isValidated
());
};
for
(
CityGmlZipEntry
entry
:
cgmlArch
.
getEntries
())
{
Checker
.
streamCheck
(
entry
,
null
,
null
,
config
,
null
);
Checker
.
streamCheck
(
entry
,
null
,
null
,
config
,
l
,
null
);
}
}
}
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