現在、Web アーカイブを保存して FileInputStream として取得するための次のコードがあります。ただし、webContent 内のチャネルは null のままで、FileNotFoundException がスローされます。
// Save the Web Archive once loading is finished
String path = context.getFilesDir().getAbsolutePath()
+ File.separator + WEB_PREFIX + postId;
webView.saveWebArchive(path);
FileInputStream webContent = null;
try {
webContent = context.openFileInput(WEB_PREFIX + postId);
} catch (FileNotFoundException e) {
Log.d("onPageFinished()", "FileNotFoundException");
e.printStackTrace();
}
代わりに context.openFileInput(path) を実行しようとすると、
09-05 23:39:42.448: E/AndroidRuntime(8399): java.lang.IllegalArgumentException: File /data/data/com.example/files/web-2189241737372651547 contains a path separator
誰かが解決策を知っていますか? 前の行でファイルを保存したので、ファイルは確かに存在します。