public void load(JarFile[] jarFiles) throws IOException {
  data=new Object[jarFiles.length][8];
  for (int i=0; i < jarFiles.length; i++) {
    JarFile jarFile=jarFiles[i];
    String fileName=jarFile.getName();
    File file=new File(fileName);
    Manifest manifest=jarFile.getManifest();
    String implementationTitle="";
    String implementationVersion="";
    String implementationVendor="";
    String specificationTitle="";
    String specificationVersion="";
    String specificationVendor="";
    if (manifest != null) {
      Attributes attributes=manifest.getMainAttributes();
      String value=attributes.getValue("Specification-Title");
      if (value != null) {
        specificationTitle=value;
      }
      value=attributes.getValue("Specification-Version");
      if (value != null) {
        specificationVersion=value;
      }
      value=attributes.getValue("Specification-Vendor");
      if (value != null) {
        specificationVendor=value;
      }
      value=attributes.getValue("Implementation-Title");
      if (value != null) {
        implementationTitle=value;
      }
      value=attributes.getValue("Implementation-Version");
      if (value != null) {
        implementationVersion=value;
      }
      value=attributes.getValue("Implementation-Vendor");
      if (value != null) {
        implementationVendor=value;
      }
    }
    data[i][0]=file.getName();
    data[i][1]=Math.round(file.length() / 1024);
    data[i][2]=specificationTitle;
    data[i][3]=specificationVersion;
    data[i][4]=specificationVendor;
    data[i][5]=implementationTitle;
    data[i][6]=implementationVersion;
    data[i][7]=implementationVendor;
  }
  fireTableDataChanged();
}

public void load ( JarFile [ ] jarFiles ) throws IOException { data = new Object [ jarFiles . length ] [ 8 ] ; for ( int i = 0 ; i < jarFiles . length ; i ++ ) { JarFile jarFile = jarFiles [ i ] ; String fileName = jarFile . getName ( ) ; File file = new File ( fileName ) ; Manifest manifest = jarFile . getManifest ( ) ; String implementationTitle = "" ; String implementationVersion = "" ; String implementationVendor = "" ; String specificationTitle = "" ; String specificationVersion = "" ; String specificationVendor = "" ; if ( manifest != null ) { Attributes attributes = manifest . getMainAttributes ( ) ; String value = attributes . getValue ( "Specification-Title" ) ; if ( value != null ) { specificationTitle = value ; } value = attributes . getValue ( "Specification-Version" ) ; if ( value != null ) { specificationVersion = value ; } value = attributes . getValue ( "Specification-Vendor" ) ; if ( value != null ) { specificationVendor = value ; } value = attributes . getValue ( "Implementation-Title" ) ; if ( value != null ) { implementationTitle = value ; } value = attributes . getValue ( "Implementation-Version" ) ; if ( value != null ) { implementationVersion = value ; } value = attributes . getValue ( "Implementation-Vendor" ) ; if ( value != null ) { implementationVendor = value ; } } data [ i ] [ 0 ] = file . getName ( ) ; data [ i ] [ 1 ] = Math . round ( file . length ( ) / 1024 ) ; data [ i ] [ 2 ] = specificationTitle ; data [ i ] [ 3 ] = specificationVersion ; data [ i ] [ 4 ] = specificationVendor ; data [ i ] [ 5 ] = implementationTitle ; data [ i ] [ 6 ] = implementationVersion ; data [ i ] [ 7 ] = implementationVendor ; } fireTableDataChanged ( ) ; }
load the jarinfotablemodel with an array of jar files .
