InputStream istream = loader.getResourceAsStream(packName + "/" + PCoder.LIBRARY_PROPERTIES);
Properties props = new Properties();
props.load(istream);
String namespace = props.getProperty("name", null);
if (namespace == null) {
throw new InterpreterException(StdErrors.extend(StdErrors.External_error, "undefined space-name in " + packName + "/" + PCoder.LIBRARY_PROPERTIES));
}
if (ressourceName.startsWith("abstrasy.")) {
Interpreter.Log("Add built-in external package : " + packName + " as " + namespace + ":*");
}
else {
Interpreter.Log("Add external package : " + packName + " as " + namespace + ":*");
}
String packFilter = packName + ".External_";
for (int i = 0; i < externals.size(); i++) {
String cname = (String) externals.elementAt(i); // doit cloner l'intitulé de la chaîne...
//System.out.println("CNAME:"+cname);
String sname = cname.substring(packFilter.length(), cname.length());
//System.out.println("SNAME:"+sname);
//
if (!((sname.charAt(0) == '_') || (sname.charAt(sname.length() - 1) == '_'))) {
sname = sname.replace('_', '-');
}
if (namedH.get(sname) != null) {
Interpreter.Log(".Replace external class : " + namespace + ":" + sname + " as " + cname);
namedH.put(sname, Node.createPattern(cname));
}
else {
Interpreter.Log(".Add external class : " + namespace + ":" + sname + " as " + cname);
namedH.put(sname, Node.createPattern(cname));
}
}
synchronized (Interpreter.Modules) {
if (Interpreter.Modules == null) {
Interpreter.Log("WARNING : Libraries null !!!...");
throw new InterpreterException(StdErrors.Internal_error);
}
if (Interpreter.Modules.get(namespace) != null) {
Interpreter.Log(".Mixin library : " + namespace + ":* ...");
//throw new InterpreterException(InterpreterException.EC_EXTERNAL,
// "Espace de nommage déjà défini : " + namespace + ":* pour " + packName);