Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
ftt
Contributor
Posts: 10
Registered: ‎02-24-2012
My Device: none
My Carrier: none

ExtendedFileConnection.setControlledAccess() and file connections leaks

Hi,

 

I have the following problem: if I try to create more than ~45 files protected with setControlledAccess, I get a "File system out of resources" error. This doesn't happen, if I omit the call to ExtendedFileConnection.setControlledAccess().

 

Here's how it happens:

  1. I use ZipInputStream form zipME library to read the next ZIP entry (so, its stream is open until I unpack all files).
  2.  When I gen the entry, I create a file (ExtendedFileConnection.setControlledAccess()ExtendedFileConnection.create()).
  3. Then I open the output stream for the newly created file (this is where an exception is eventually raised).
  4. Then I copy bytes from one stream into another, close the output stream, close the output file, go to the next ZIP entry.

All close() calls are done in finally blocks. And this all works without any problems, if I omit the call to ExtendedFileConnection.setControlledAccess(). If I keep that call, eventually, I'm out of file handles.

 

Note: this is actually a JS extension for a WebWorks app, but as it is written in Java, I think it's more relevant here.

 

BlackBerry Development Advisor
Posts: 15,700
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: ExtendedFileConnection.setControlledAccess() and file connections leaks

Which BlackBerry Smartphone model and BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.  Can you post a sample that reproduces this issue here or in Issue Tracker?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
ftt
Contributor
Posts: 10
Registered: ‎02-24-2012
My Device: none
My Carrier: none

Re: ExtendedFileConnection.setControlledAccess() and file connections leaks

I don't work there anymore, so don't have access to devices, but it was on OS 6. Re: the sample — is there anything unclear in my description?