黑莓文件连接非法状态异常
我正在开发一个使用 FileConnection 接口写入文件系统的 Blackberry 应用程序。
当我尝试对某个文件调用 delete() 时,出现 IllegalStateException。堆栈跟踪如下
IllegalStateException
No detail message
net_rim_os
FileImpl
remove
0x373D
net_rim_os-6
ContentStoreConnection
delete
0x12DA
com_companyName_blackberryClient-7
FileUtility
<private>
0x14C6
堆栈跟踪显示异常发生在 FileImpl 中的remove() 中,但我在任何地方都找不到有关此方法的任何信息(看起来它是一个内部黑莓类)
该文件位于
file:///store/home/user/appName
有谁知道为什么删除该目录中的文件会导致非法状态异常吗?
我们只见过这个问题一次,而且事实证明很难重现。如果确实发生这种情况,则可能是在同一目录中创建并访问了其他几个文件。这会是异常发生的一个因素吗?
Blackberry OS版本是4.5.0.180,api版本是4.5.0
I am working on a Blackberry application that writes to the file system using the FileConnection interface.
I am getting a IllegalStateException when I try to call delete() on a certain file. The stack trace is as follows
IllegalStateException
No detail message
net_rim_os
FileImpl
remove
0x373D
net_rim_os-6
ContentStoreConnection
delete
0x12DA
com_companyName_blackberryClient-7
FileUtility
<private>
0x14C6
The stack trace shows the exception occurs in remove() in FileImpl but I cannot find any information about this method anywhere (looks like it is a internal blackberry class)
The file is located in
file:///store/home/user/appName
Does anyone know why deleting a file from that directory would cause an illegalStateException?
We have only seen this problem once and it is proving hard to reproduce. The one occasion it did occur it is possible that there were other several other files being created and accessed in the same directory. Would this be a factor in the exception occurring?
The Blackberry OS version is 4.5.0.180 and the api version is 4.5.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查您尝试删除的文件是否未被其他线程打开。我过去在忘记正确 close() FileConnection 或 InputStream 时遇到过这个问题。
Check that the file you are trying to delete is not open by another Thread. I've had this problem when forgetting to properly close() a FileConnection or InputStream in the past.