package jas2.util.pluginmanager;
import java.net.*;
public class PluginProperties{
public String path;
public String name;
public String author;
public String currversion;
public String description;
private String nodescription;
public String latestversion;
public String requires;
public URL[] urldownloads;
private URL nodownloadurl;
public int state;
public String[] files;
public String minJASversion;
public boolean removeable;
public boolean installable;
public final static int NOTINSTALLED = 0;
public final static int LOADED = 1;
public PluginProperties(){
this.path="unknown";
this.name="unknown";
this.author="unknown";
this.currversion="unknown";
this.description = "No information describing the usage of this plugin was supplied";
this.latestversion = "unknown";
this.requires = "unknown";
this.state =NOTINSTALLED;//through excepion
this.urldownloads = null;
this.files = null;
this.minJASversion="0.0.0";
this.removeable = true;
this.installable = false;
}
public PluginProperties(String path, String name, String author, String currversion, String description, String latestversion, String requires, URL[] urldownloads, int state, String[] files, String minJASversion, boolean removeable,boolean installable ){
if(path!=null)this.path=path;
else this.path = "unknown";
//if name includes extension , chop it off
if(name!=null){
int index = name.lastIndexOf(".");
if(index > 0)this.name = name.substring(0,index);
else this.name =name;
}else this.name="unknown";
if(author!=null) this.author=author;
else this.author="unknown";
if(currversion!=null) this.currversion=currversion;
else this.currversion="unknown";
if(description != null)this.description =description;
else this.description = "No information describing the usage of this plugin was supplied";
if(latestversion != null)this.latestversion =latestversion;
else this.latestversion = "unknown";
if(requires != null)this.requires =requires;
else this.requires = "unknown";
if(minJASversion != null)this.minJASversion =minJASversion;
else this.minJASversion = "0.0.0";
this.removeable = removeable;
this.installable = installable;
if(state <0 | state >1)System.out.println("plugin properties state must be greater either 0 or 1, notinstalled or loaded");
else this.state =state;
this.files =files;
this.urldownloads =urldownloads;
}
void setState(int state){
if(state <0 | state >1)System.out.println("plugin properties state must be greater either 0 or 1, notinstalled or loaded");
else this.state =state;
}
String[] getFiles(){
return files;
}
}
Ads help maintain this website.