小编Ing*_*ias的帖子

java.io.IOException:系统找不到指定的写入文本文件的路径

我正在编写一个程序,我正在尝试在当前目录中创建一个新的文本文件,然后写一个字符串给它.但是,在尝试创建文件时,这段代码:

//Create the output text file.
File outputText = new File(filePath.getParentFile() + "\\Decrypted.txt");
try
{
    outputText.createNewFile();
}
catch (IOException e)
{
    e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

给我这个错误信息:

java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(Unknown Source)
    at code.Crypto.decrypt(Crypto.java:55)
    at code.Crypto.main(Crypto.java:27)
Run Code Online (Sandbox Code Playgroud)

因此,我无法写入文件,因为它自然不存在.我在这做错了什么?

java ioexception text-files

9
推荐指数
1
解决办法
2万
查看次数

相当于Selenium Webdriver中MarionetteDriver的FirefoxDriver(*profile*)?

我正在尝试将一些Selenium测试转换FirefoxDriverMarionetteDriver,但我遇到了有关PKI的问题.到目前为止,我的解决方案是使用各种Firefox配置文件,这些配置文件只有一个自定义PKI并自动选择用于登录目的.但是,似乎MarionetteDriver构造函数无法使用自定义配置文件启动Firefox.我该如何解决?

我在Python中通过让Python连接到Marionette之前启动Firefox来解决这个问题,但我不知道Selenium WebDriver是否具备此功能.

java selenium selenium-webdriver firefox-marionette

2
推荐指数
1
解决办法
2781
查看次数