Added HttpFilePage to hosts static content
This commit is contained in:
parent
15162b2cb0
commit
18e3175db9
7 changed files with 220 additions and 39 deletions
|
|
@ -56,13 +56,13 @@ public class PluginData {
|
|||
|
||||
pluginVersion = data.getDouble("version");
|
||||
pluginName = data.getString("name");
|
||||
log.fine("Found plugin: "+pluginName);
|
||||
log.fine("Plugin: "+this);
|
||||
|
||||
DataNode node = data.get("interfaces");
|
||||
Iterator<String> intfIt = node.keyIterator();
|
||||
while (intfIt.hasNext()) {
|
||||
String intf = intfIt.next();
|
||||
log.finer("Plugin interface: "+ intf+"-->"+node.get(intf).getString());
|
||||
log.finer("Plugin interface: "+ intf+" --> "+node.get(intf).getString());
|
||||
classMap.put(
|
||||
getClassByName(intf),
|
||||
getClassByName(node.get(intf).getString()));
|
||||
|
|
@ -98,4 +98,8 @@ public class PluginData {
|
|||
public boolean contains(Class<?> intf){
|
||||
return classMap.containsKey(intf);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return getName()+"(ver: "+getVersion()+")";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,12 +71,22 @@ public class PluginManager<T> implements Iterable<PluginData>{
|
|||
for(FileSearch.FileSearchItem file : search){
|
||||
try {
|
||||
DataNode node = JSONParser.read(IOUtil.getContentString(file.getInputStream()));
|
||||
log.fine("Found plugin: "+file.getPath());
|
||||
PluginData plugin = new PluginData(node);
|
||||
|
||||
if (!plugins.containsKey(plugin.getName()) ||
|
||||
plugins.get(plugin.getName()).getVersion() < plugin.getVersion()){
|
||||
if (!plugins.containsKey(plugin.getName())){
|
||||
plugins.put(plugin.getName(), plugin);
|
||||
}
|
||||
else {
|
||||
double version = plugins.get(plugin.getName()).getVersion();
|
||||
if(version < plugin.getVersion())
|
||||
plugins.put(plugin.getName(), plugin);
|
||||
else if(version == plugin.getVersion())
|
||||
log.fine("Ignoring duplicate plugin: " + plugin);
|
||||
else
|
||||
log.fine("Ignoring outdated plugin: "+plugin);
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue