+ ret = true;\r
+ }\r
+ \r
+ } catch (HttpException e) {\r
+ Log.e(TAG, "HTTP exception downloading " + remoteFilepath, e);\r
+ caughtException = true;\r
+\r
+ } catch (IOException e) {\r
+ Log.e(TAG, "I/O exception downloading " + remoteFilepath, e);\r
+ caughtException = true;\r
+\r
+ } catch (Exception e) {\r
+ Log.e(TAG, "Unexpected exception downloading " + remoteFilepath, e);\r
+ caughtException = true;\r
+ \r
+ } finally {\r
+ if (!ret) {\r
+ if (!caughtException) {\r
+ Log.e(TAG, "Download of " + remoteFilepath + " to " + targetFile + " failed with HTTP status " + status);\r
+ }\r
+ if (targetFile.exists()) {\r
+ targetFile.delete();\r
+ }\r