-\r
- final InputStream in;\r
- final FileOutputStream out;\r
-\r
- final File destFile = new File(dest);\r
- final File destTmpFile;\r
- try {\r
- destTmpFile = File.createTempFile("dictionaryDownload", "tmp", destFile\r
- .getParentFile());\r
- destTmpFile.deleteOnExit();\r
- final URL uri = new URL(source);\r
- final URLConnection connection = uri.openConnection();\r
- contentLength = connection.getContentLength();\r
- in = connection.getInputStream();\r
- out = new FileOutputStream(destTmpFile);\r
- } catch (Exception e) {\r
- Log.e("THAD", "Error downloading file", e);\r
- setDownloadStatus(String.format(getString(R.string.errorDownloadingFile), e.getLocalizedMessage()));\r
- return;\r
- }\r