getAppHomePath()メソッドに問題があります。このメソッドは、デバッガで "file:// home /"を返し、その後FileNotFoundExceptionを取得します。getAppHomePath()がシミュレータで間違ったパスをスローしているようですか?
それが例外をスローコード:
fileName = "100004_2016-06-29.jpg"
appHomePath = FileSystemStorage.getInstance().getAppHomePath();
img = Image.createImage(Storage.getInstance().createInputStream(appHomePath + fileName));
ExceptionMessage:
java.io.FileNotFoundException: C:\Users\xyz\.cn1\file___home_100004_2016-06-29.jpg (Das System kann die angegebene Datei nicht finden)
ので、それはパスを破壊し、この接頭辞 "file___home_" を追加しているようですが、私は「間違いなくファイルを持っている100004_2016 -06-29.jpg "と入力します。
そのパスの下にファイルが以下であることを作成しスニペット:
img = Image.createImage(FileSystemStorage.getInstance().openInputStream(filePath));
OutputStream os = Storage.getInstance().createOutputStream(newFileName);
ImageIO.getImageIO().save(img, os, ImageIO.FORMAT_JPEG, 1.0f);
filePathに変数は、イメージギャラリーで返され、%TEMP%ディレクトリの下にその何かそう。
とにかくファイルを保存すると、何とか読み込みができません。
シミュレータコードに何か不足していますか、実際にはバグがありますか?