diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-07-11 13:53:27 +0200 |
---|---|---|
committer | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-07-11 13:53:27 +0200 |
commit | 652d8b3b851b7c1d41668401d359cc7c1e0c2cd6 (patch) | |
tree | b5488d6b08168277876ebbe07e8638fa61dffec1 | |
parent | 8f7349f8dfefc74f422f13c2b95494a6cf8237d5 (diff) | |
parent | 3e1e70b8c2fcb1a6d77483743a891723ae9dc7a6 (diff) |
Merge pull request #7480 from koying/quickPR
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in index c6a3313c02..6dc74d4070 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in +++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in @@ -172,13 +172,19 @@ public class Splash extends Activity { InputStream input = null; OutputStream output = null; HttpURLConnection connection = null; - int ret = 0; String src = sUrl[0]; String dest = sUrl[1]; + File fObb = new File(dest); Log.d(TAG, "Downloading " + src + " to " + dest); + if (!fObb.getParentFile().exists() && !fObb.getParentFile().mkdirs()) { + Log.e(TAG, "Error creating directory " + fObb.getParentFile().getAbsolutePath()); + return -1; + } + + int ret = 0; try { URL url = new URL(src); connection = (HttpURLConnection) url.openConnection(); @@ -232,10 +238,7 @@ public class Splash extends Activity { if (ret == 0) mState = DownloadObbDone; else - { - File obb = new File(dest); - obb.delete(); - } + fObb.delete(); publishProgress(0); return ret; |