Package freenet.pluginmanager

Source Code of freenet.pluginmanager.PluginDownLoaderOfficialFreenet

package freenet.pluginmanager;

import freenet.client.HighLevelSimpleClient;
import freenet.keys.FreenetURI;
import freenet.node.Node;
import freenet.pluginmanager.OfficialPlugins.OfficialPluginDescription;

public class PluginDownLoaderOfficialFreenet extends PluginDownLoaderFreenet {

  public PluginDownLoaderOfficialFreenet(HighLevelSimpleClient client, Node node, boolean desperate) {
    super(client, node, desperate);
  }

  @Override
  public FreenetURI checkSource(String source) throws PluginNotFoundException {
    OfficialPluginDescription desc = node.getPluginManager().getOfficialPlugin(source);
    if(desc == null) throw new PluginNotFoundException("Not in the official plugins list: "+source);
    if(desc.uri != null)
      return desc.uri;
    else {
      return node.nodeUpdater.getURI().setDocName(source).setSuggestedEdition(desc.minimumVersion).sskForUSK();
    }
  }
 
  @Override
  String getPluginName(String source) throws PluginNotFoundException {
    return source + ".jar";
  }
 
  public boolean isOfficialPluginLoader() {
    return true;
  }
 
}
TOP

Related Classes of freenet.pluginmanager.PluginDownLoaderOfficialFreenet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.