Skip to content

Commit eba3233

Browse files
authored
Merge pull request #11495 from GlobalDataverseCommunityConsortium/DDIFix
Fix DDI Exception
2 parents d8a55a9 + cb53c9c commit eba3233

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/main/java/edu/harvard/iq/dataverse/export/DDIExporter.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,11 @@ public String getDisplayName(Locale locale) {
4747

4848
@Override
4949
public void exportDataset(ExportDataProvider dataProvider, OutputStream outputStream) throws ExportException {
50-
XMLStreamWriter xmlw = null;
51-
//XMLStreamWriter is not auto-closable - can't use try-with-resources here
5250
try {
53-
xmlw = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream);
54-
xmlw.writeStartDocument();
55-
xmlw.flush();
5651
DdiExportUtil.datasetJson2ddi(dataProvider.getDatasetJson(), dataProvider.getDatasetFileDetails(),
5752
outputStream);
5853
} catch (XMLStreamException xse) {
5954
throw new ExportException("Caught XMLStreamException performing DDI export", xse);
60-
} finally {
61-
if (xmlw != null) {
62-
try {
63-
xmlw.close();
64-
} catch (XMLStreamException e) {
65-
// Log this exception, but don't rethrow as it's not the primary issue
66-
e.printStackTrace();
67-
}
68-
}
6955
}
7056
}
7157

0 commit comments

Comments
 (0)