I'm using svyIO.zip() to create a zip file of PDFs. In the new 1.4.1 I get the following exception:
- Code: Select all
ERROR com.servoy.j2db.util.Debug - ERROR Error zipping file "C:\Servoy_Files\2020-4-9_13-47-11": java.util.zip.ZipException: no current ZIP entry
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:2281
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:2145
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1353
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1524
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyLogManager.js:1637
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js:249 (zip)
at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3309 (zipFolderDownload)
at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3257 (searchPdfExport)
ERROR com.servoy.j2db.util.Debug - JavaException: java.util.zip.ZipException: no current ZIP entry (C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js#250) (Form Context: frmSearchMain), JSEvent(type = action, source = RuntimeScriptButton, formName = frmSearchMain, elementName = <no name>, timestamp = Thu Apr 09 13:47:11 EDT 2020,modifiers = 0,x =5,y = 6,data = null) JavaException: java.util.zip.ZipException: no current ZIP entry
at C:\Users\pbdavis\servoy_workspace_2020.03\svyUtils\svyIO.js:250 (zip)
at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3309 (zipFolderDownload)
at C:\Users\pbdavis\servoy_workspace_2020.03\TIGER_9_FBM\forms\frmSearchMain.js:3257 (searchPdfExport)
The exception occurs on the line
- Code: Select all
dest.write(buffer);
- Code: Select all
function channelCopy(src, dest) {
var buffer = java.nio.ByteBuffer.allocateDirect(16 * 1024);
while (src.read(buffer) != -1) {
// prepare the buffer to be drained
buffer.flip();
// write to the channel, may block
dest.write(buffer);
// If partial transfer, shift remainder down
// If buffer is empty, same as doing clear()
buffer.compact();
}
// EOF will leave buffer in fill state
buffer.flip();
// make sure the buffer is fully drained.
while (buffer.hasRemaining()) {
dest.write(buffer);
}
src.close();
}
Tested svyUtil 1.3.1 svyIO.zip() with Servoy 2020.03 and it works fine.
I could not find any requirements on java version needed.
Any idea on why this fails?
Thanks,