Skip to content

Commit f48c43d

Browse files
Tom HollanderTom Hollander
authored andcommitted
fix IOS issue
fix IOS issue -q
1 parent aa4e338 commit f48c43d

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

intelli-qs-plugin.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
99
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
1010
</content>
11-
<orderEntry type="inheritedJdk" />
11+
<orderEntry type="jdk" jdkName="IntelliJ IDEA IU-162.1447.26" jdkType="IDEA JDK" />
1212
<orderEntry type="sourceFolder" forTests="false" />
1313
</component>
1414
</module>

src/com/qualisystems/pythonDriverPlugin/QualiPublishDriverAction.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616
import com.qualisystems.pythonDriverPlugin.updaters.IUpdater;
1717
import com.qualisystems.pythonDriverPlugin.updaters.UpdaterFactory;
1818
import org.jetbrains.annotations.NotNull;
19+
import org.xml.sax.*;
1920

2021
import javax.xml.bind.JAXBContext;
2122
import javax.xml.bind.JAXBElement;
2223
import javax.xml.bind.JAXBException;
2324
import javax.xml.bind.Unmarshaller;
25+
import javax.xml.parsers.ParserConfigurationException;
26+
import javax.xml.parsers.SAXParserFactory;
27+
import javax.xml.transform.sax.SAXSource;
2428
import java.io.File;
29+
import java.io.FileReader;
2530
import java.io.IOException;
2631
import java.io.InputStream;
2732
import java.net.UnknownHostException;
@@ -132,15 +137,34 @@ private DriverPublisherSettings getDeploymentSettingsFromFile(File deploymentSet
132137
try {
133138
InputStream inputStream = Files.newInputStream(deploymentSettingsFile.toPath());
134139
jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
140+
141+
SAXParserFactory spf = SAXParserFactory.newInstance();
142+
spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
143+
spf.setFeature("http://xml.org/sax/features/validation", false);
144+
145+
XMLReader xmlReader = spf.newSAXParser().getXMLReader();
146+
InputSource inputSource = new InputSource(inputStream);
147+
SAXSource source = new SAXSource(xmlReader, inputSource);
148+
135149
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
136-
JAXBElement<PropertiesType> unmarshalledObject = (JAXBElement<PropertiesType>)unmarshaller.unmarshal(inputStream);
150+
151+
JAXBElement<PropertiesType> unmarshalledObject = (JAXBElement<PropertiesType>)unmarshaller.unmarshal(source);
137152

138153
PropertiesType properties = unmarshalledObject.getValue();
139154
DriverPublisherSettings settings = DriverPublisherSettings.fromProperties(properties);
140155
return settings;
141156

142157
} catch (JAXBException e) {
143158
throw new IOException(e);
159+
} catch (SAXNotSupportedException e) {
160+
e.printStackTrace();
161+
} catch (SAXNotRecognizedException e) {
162+
e.printStackTrace();
163+
} catch (SAXException e) {
164+
e.printStackTrace();
165+
} catch (ParserConfigurationException e) {
166+
e.printStackTrace();
144167
}
168+
return null;
145169
}
146170
}

0 commit comments

Comments
 (0)