Skip to content

Commit b5804b5

Browse files
committed
Support Reading CloudServices.config from JAR File
1 parent bec6c12 commit b5804b5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

common/src/main/java/com/genexus/ApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public boolean checkIfResourceExist(String path)
132132
if (isSpringBootApp())
133133
return new ClassPathResource(path).exists();
134134
else
135-
return new File(path).exists();
135+
return new File(path).exists() || getClass().getClassLoader().getResource(path) != null;
136136
}
137137

138138
public void setEJBEngine(boolean isEJBEngine)

common/src/main/java/com/genexus/xml/XMLReader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,11 @@ public void open(String url)
785785
else
786786
{
787787
File xmlFile = new File(url);
788-
fileInputStream = new FileInputStream(xmlFile);
788+
if (xmlFile.exists())
789+
fileInputStream = new FileInputStream(xmlFile);
790+
else {
791+
fileInputStream = getClass().getClassLoader().getResourceAsStream(url);
792+
}
789793
}
790794
inputSource = new XMLInputSource(null, url, null, fileInputStream, null);
791795
if (documentEncoding.length() > 0)

0 commit comments

Comments
 (0)