Java 如何在adf mobile中创建文件
我用这段代码在手机设备上创建一些文件,例如:txt,pdf…等等Java 如何在adf mobile中创建文件,java,file,mobile,oracle-adf,Java,File,Mobile,Oracle Adf,我用这段代码在手机设备上创建一些文件,例如:txt,pdf…等等 try { File file = new File("myfile.txt"); if (file.createNewFile()) { //throw new AdfException("crée", AdfException.INFO); } else { throw
try
{
File file = new File("myfile.txt");
if (file.createNewFile())
{
//throw new AdfException("crée", AdfException.INFO);
}
else
{
throw new AdfException("non crée", AdfException.INFO);
}
}
catch (IOException e)
{
throw new AdfException(e.getMessage(), AdfException.INFO);
}
但我有一条错误消息:只读文件系统我认为您需要在应用程序文件夹下创建文件
String dir = AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory);
String filePath= dir + "/myfile.txt";
try
{
File file = new File(filePath);
if (file.createNewFile())
{
//throw new AdfException("crée", AdfException.INFO);
}
else
{
throw new AdfException("non crée", AdfException.INFO);
}
}
catch (IOException e)
{
throw new AdfException(e.getMessage(), AdfException.INFO);
}
非常感谢。另一个问题,如何使用adf Mobile查找电话名或imei id欢迎,如果问题已解决,请将其标记为正确答案,同时为了组织起见,请在单独的帖子中询问其他问题。