cancel
Showing results for 
Search instead for 
Did you mean: 

access Alfresco file directory?

esource
Champ on-the-rise
Champ on-the-rise
with Java, from within Alfresco, what is the correct syntax, what classes do I call, to access the Alfresco file directory?  For example if I want to access with Java the templates located under …\WEB-INF\classes\alfresco\templates\  how can I do this?
10 REPLIES 10

esource
Champ on-the-rise
Champ on-the-rise
SInce you may assume that both tomcat/shared/classes and alfresco/WEB-INF/classes are in the classpath, you can access them as resource.
Something like that (untested):

ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream is = cl.getResourceAsStream("/alfresco/templates/foobar.ftl")

HTH
Gyro

it found a resource I placed under alfresco/WEB-INF/classes but not under tomcat/shared/classes.  would you know how I can locate resources placed under tomcat/shared/classes?