I'm learning to read File Properties of MS Office documents using Apache POI HPSF. I copied this code after importing the JAR files. The How-To page discusses exceptions which might be thrown but none of them include "ArrayIndexOutOfBoundsException caused by the line:
final String file = args[0];
Here's the fulle code:
import java.io.*;
import org.apache.poi.hpsf.*;
import org.apache.poi.poifs.eventfilesystem.*;
// ...
public static void main(String[] args) throws IOException {
final String filename = args[0];
POIFSReader r = new POIFSReader();
r.registerListener(new MyPOIFSReaderListener(),
"\005SummaryInformation");
r.read(new FileInputStream(filename));
}
I appreciate your help.