admin-announcements

Announcements from the Clojurians Admin Team (@U11BV7MTK @U077BEWNQ @U050TNB9F @U0ETXRFEW @U04V70XH6 @U8MJBRSR5 and others)
nullptr 2015-10-05T15:50:51.000024Z

nicholasf: yes, but it’s basically just an email form

shofetim 2015-10-05T19:59:09.000026Z

This is maybe obvious to someone who has a background in Java... I have a clojure function that accesses a path ("templates/feedback.xlsx") under resources. I need to call it both from a quartzite job, and from a compojure route. However it seems compojure changes the "base" from which the relative path starts.... how can I make it so both calls to the function can access the file?

jstew 2015-10-05T20:07:27.000027Z

@shofetim: You can use http://clojure.java.io/resource to access a resource that's on the classpath:

(-> "templates/feedback.xslx" io/resource io/file)

shofetim 2015-10-05T20:17:02.000028Z

@jstew:

(io/resource "resources/templates/feedback.xslx")
(io/resource "templates/feedback.xslx")

shofetim 2015-10-05T20:17:07.000029Z

both return nil

jstew 2015-10-05T20:23:38.000031Z

you don't need the leading "resources" in the first example , but if in your project that file is indeed in <project root>/resources/templates/feedback.xslx it'll work.