Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Below line of code has been written in thingworx java extension in eclipse
InputStream in=TestThingShape.class.getResourceAsStream("test.xlsx");
Where does the file test.xlsx is present in Thingworx server?
Please help me over here.
check out in following path, if it is windows..
C:\Program Files (x86)\ThingWorxFoundation\tomcat\apache-tomcat-9.0.62\test.xslx
Also refer following post..
https://community.ptc.com/t5/ThingWorx-Developers/Thingworx-java-extension/m-p/857179#M61298
https://community.ptc.com/t5/ThingWorx-Developers/Thingworx-extension-java/m-p/858158#M61345
The response is a bit more complex than that. Class#getResourceAsStream allows you to access files on the Java classpath, i.e. embedded inside the JARs. Your test.xlsx should be packaged in the same JAR as your TestThingShape, side-by-side with TestThingShape.class file. The JAR is then zipped together with metadata.xml to produce the extension bundle.