Skip to content

Commit

Permalink
geonetwork harvest update
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogeweg committed Nov 26, 2024
1 parent 219f065 commit 66a4925
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:geonet="http://www.fao.org/geonetwork"

exclude-result-prefixes="csw dct">
<xsl:output indent="yes" method="xml" omit-xml-declaration="no"/>
<xsl:template match="/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ public PublishingStatus publish(DataReference ref) throws DataOutputException {
for (MimeType ct: ref.getContentType()) {
String extension = MimeTypeUtils.findExtensions(ct).stream().findFirst().orElse(null);
if (extension!=null) {

Path f = generateFileName(ref.getBrokerUri(), ref.getSourceUri(), ref.getTitle() , extension);
String title = ref.getTitle();
if (title.length() < 1) {
title = ref.getSourceUri().toString().replace(":", "_");
}
Path f = generateFileName(ref.getBrokerUri(), ref.getSourceUri(), title, extension);
boolean created = !Files.exists(f);
Files.createDirectories(f.getParent());
try (OutputStream output = Files.newOutputStream(f)) {
Expand Down

0 comments on commit 66a4925

Please sign in to comment.