use of lucee.commons.io.res.Resource in project Lucee by lucee.
the class ConfigImpl method getRPCClassLoader.
@Override
public ClassLoader getRPCClassLoader(boolean reload) throws IOException {
if (rpcClassLoader != null && !reload)
return rpcClassLoader;
Resource dir = getClassDirectory().getRealResource("RPC");
if (!dir.exists())
dir.createDirectory(true);
rpcClassLoader = new PhysicalClassLoader(this, dir, null, false);
return rpcClassLoader;
}
use of lucee.commons.io.res.Resource in project Lucee by lucee.
the class ConfigImpl method getScriptMapping.
/* *
* @return the tagDirectory
public Resource getTagDirectory() {
return tagDirectory;
} */
/**
* mapping used for script (JSR 223)
* @return
*/
public Mapping getScriptMapping() {
if (scriptMapping == null) {
// Physical resource TODO make in RAM
Resource physical = getConfigDir().getRealResource("jsr223");
if (!physical.exists())
physical.mkdirs();
this.scriptMapping = new MappingImpl(this, "/mapping-script/", physical.getAbsolutePath(), null, ConfigImpl.INSPECT_NEVER, true, true, true, true, false, true, null, -1, -1);
}
return scriptMapping;
}
use of lucee.commons.io.res.Resource in project Lucee by lucee.
the class ConfigServerImpl method loadLocalExtensions.
@Override
public List<ExtensionDefintion> loadLocalExtensions() {
Resource[] locReses = getLocalExtensionProviderDirectory().listResources(new ExtensionResourceFilter(".lex"));
if (localExtensions == null || localExtSize != locReses.length || extHash(locReses) != localExtHash) {
localExtensions = new ArrayList<ExtensionDefintion>();
Map<String, String> map = new HashMap<String, String>();
RHExtension ext;
String v, fileName, uuid, version;
ExtensionDefintion ed;
for (int i = 0; i < locReses.length; i++) {
ed = null;
// we stay happy with the file name when it has the right pattern (uuid-version.lex)
fileName = locReses[i].getName();
if (fileName.length() > 39) {
uuid = fileName.substring(0, 35);
version = fileName.substring(36, fileName.length() - 4);
if (Decision.isUUId(uuid)) {
ed = new ExtensionDefintion(uuid, version);
ed.setSource(this, locReses[i]);
}
}
if (ed == null) {
try {
ext = new RHExtension(this, locReses[i], false);
ed = new ExtensionDefintion(ext.getId(), ext.getVersion());
ed.setSource(ext);
} catch (Exception e) {
SystemOut.printDate(e);
}
}
if (ed != null) {
// check if we already have an extension with the same id to avoid having more than once
v = map.get(ed.getId());
if (v != null && v.compareToIgnoreCase(ed.getId()) > 0)
continue;
map.put(ed.getId(), ed.getVersion());
localExtensions.add(ed);
}
}
localExtHash = extHash(locReses);
// we store the size because localExtensions size could be smaller because of duplicates
localExtSize = locReses.length;
}
return localExtensions;
}
use of lucee.commons.io.res.Resource in project Lucee by lucee.
the class ConfigServerImpl method getSecurityDirectory.
@Override
public Resource getSecurityDirectory() {
Resource cacerts = null;
// javax.net.ssl.trustStore
String trustStore = SystemUtil.getPropertyEL("javax.net.ssl.trustStore");
if (trustStore != null) {
cacerts = ResourcesImpl.getFileResourceProvider().getResource(trustStore);
}
// security/cacerts
if (cacerts == null || !cacerts.exists()) {
cacerts = getConfigDir().getRealResource("security/cacerts");
if (!cacerts.exists())
cacerts.mkdirs();
}
return cacerts;
}
use of lucee.commons.io.res.Resource in project Lucee by lucee.
the class ConfigWebImpl method getDebuggerPool.
public DebuggerPool getDebuggerPool() {
if (debuggerPool == null) {
Resource dir = getConfigDir().getRealResource("debugger");
dir.mkdirs();
debuggerPool = new DebuggerPool(dir);
}
return debuggerPool;
}
Aggregations