現在のディレクトリに新しいテキストファイルを作成し、それに文字列を書き込もうとしているプログラムを書いています。ただし、ファイルを作成しようとすると、次のコードブロックが表示されます。
//Create the output text file.
File outputText = new File(filePath.getParentFile() + "\\Decrypted.txt");
try
{
outputText.createNewFile();
}
catch (IOException e)
{
e.printStackTrace();
}
私にこのエラーメッセージを与えています:
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)
このため、ファイルは自然に存在しないため、ファイルに書き込むことができません。私はここで何が間違っているのですか?