1

I try to use this function:

downloadBytes(exportLink.@href)

but I get array of bytes. How can I get zip file.

Oleg Baranovsky
  • 368
  • 5
  • 22

2 Answers2

1

A file is nothing but an array of bytes. What do you need to actually do? You can save it somewhere by using a FileOutputStream, for example. You can use a ZipInputStream (with a ByteArrayInputStream) to read the entries directly in Java... So, what do you want to actually do?

Florian Schaetz
  • 10,454
  • 5
  • 32
  • 58
1

I found another solution for saving zip in geb without asking directory. I configured my GebConfig.groovy :

    profile.setPreference("browser.download.folderList",2)
    profile.setPreference("browser.download.manager.showWhenStarting",false)
    profile.setPreference("browser.download.dir", new File("").getAbsolutePath())
    profile.setPreference("browser.helperApps.neverAsk.saveToDisk","application/zip") 
Oleg Baranovsky
  • 368
  • 5
  • 22