Mittwoch, 12. Oktober 2016

getting Files and Directories of a Folder in BBj

showcase demonstrates how to get the used jasper version of BBj by using a complete scan of the lib directory files:
        jasperVersion$="?.?.?"
        declare java.io.File f!
        declare BBjString path!
        path! = cast(BBjString,System.getProperty("basis.BBjHome")+"\lib\").replaceAll("/\\","\").replace("\\","\")
        f! = new java.io.File( path! )
        if (f!<>null()) then
          javaList! = java.util.Arrays.asList( f!.listFiles() )
          for i=0 to javaList!.size()-1
            f! = cast(java.io.File,javaList!.get(i))
            if (!f!.isDirectory()) then
                if (f!.getName().contains("jasperreports-javaflow-")) then
                  jasperVersion$ = f!.getName().replaceAll("jasperreports-javaflow-|.jar","")
                endif
            endif
          next i
        endif
Benefit from the best Windows Desktop app in the world and use Strokey.Net!

Keine Kommentare:

Kommentar posten