0

I try to read an Excel file with Apache POI. The project uses CDI. So i need to inject an Handler. This Handler needs a SharedStringTable as constructor parameter. So my constructor looks like this.

@Inject
public Handler(SharedStringTable sst) {
    this.sst = sst
}

I have started to write a producer for the SharedStringTable but this object needs an inputStream to be produced.

This is the code that i have for the producer :

@Produces
public SharedStringTable gets(InjectionPoint ip) {
    // How i can get this InputStream?
    OPCPackage pkg = OPCPackage.open(is);
    is.close();
    XSSFReader r = new XSSFREADER(pkg)
    SharedStringTable sst = r.getSharedStringTable();
    return sst;     
}

Someone as idea to help me?

Scandinave
  • 1,388
  • 1
  • 17
  • 41

0 Answers0