- File bsRoot = new File(Environment.getExternalStorageDirectory(), "BarcodeScanner");
- File barcodesRoot = new File(bsRoot, "Barcodes");
- if (!barcodesRoot.mkdirs()) {
- Log.v(TAG, "Couldn't make dir " + barcodesRoot);
- showErrorMessage(R.string.msg_unmount_usb);
- return true;
- }
- barcodeFile = new File(barcodesRoot, makeBarcodeFileName(contents) + ".png");
- barcodeFile.delete();
- FileOutputStream fos = null;
- try {
- fos = new FileOutputStream(barcodeFile);
- bitmap.compress(Bitmap.CompressFormat.PNG, 0, fos);
- } catch (FileNotFoundException fnfe) {
- Log.v(TAG, "Couldn't access file " + barcodeFile + " due to " + fnfe);
- showErrorMessage(R.string.msg_unmount_usb);
- return true;
- } finally {
- if (fos != null) {
+ fos = new FileOutputStream(barcodeFile);
+ bitmap.compress(Bitmap.CompressFormat.PNG, 0, fos);
+ } catch (FileNotFoundException fnfe) {
+ Log.w(TAG, "Couldn't access file " + barcodeFile + " due to " + fnfe);
+ showErrorMessage(R.string.msg_unmount_usb);
+ return true;
+ } finally {
+ if (fos != null) {
+ try {