Søk i denne bloggen

fredag 9. september 2011

Read properties from the netbeans module manifest runtime

Here is how to read the netbeans modules manifest run time:


public class Installer extends ModuleInstall {
    @Override
    public void restored() {
    InputStream manifestStream = this.getClass().getClassLoader()
                                 .getResourceAsStream("META-INF/MANIFEST.MF");
    try {
        Manifest manifest = new Manifest(manifestStream);
        Attributes attributes = manifest.getMainAttributes();
        String impVersion = attributes.getValue("Implementation-Build");
        System.out.println(impVersion);
    }
    catch(Exception ex) {
    }
}

Ingen kommentarer:

Legg inn en kommentar