如何通过文件连接创建文件? [英] how can i create file by fileconnection?

查看:95
本文介绍了如何通过文件连接创建文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FileConnection fc = (FileConnection)Connector.open("file:///root1/text.txt");
        if (!fc.exists())
        fc.create();


此代码在我的计算机上工作..在我的手机上抛出异常(访问被拒绝).


this code work in my computer..put in my mobile throws Exception(access denied).

推荐答案

访问被拒绝不能访问该文件夹.提供执行此操作所需的访问权限,或找到另一个允许进行此类修改的文件夹.
Access denied Exception occurs when there is no Access to the folder. Either provide the necessary access to do such operation or find another folder that allows such modifications.


这篇关于如何通过文件连接创建文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆