Skip to content

Commit

Permalink
feat(filedownloader.properties): handle the known FileNotFound except…
Browse files Browse the repository at this point in the history
…ion when loading the filedownloader.properties
  • Loading branch information
Jacksgong committed Apr 19, 2016
1 parent 58e733a commit fc0b38d
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
* FileDownloadService runs in the main process, and by default the FileDownloadService runs in the
* separate `:filedownloader` process.
*/
public class FileDownloadService extends Service {
public class FileDownloadService extends Service {

private IFileDownloadServiceHandler handler;

Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
*/
package com.liulishuo.filedownloader.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
@@ -139,7 +140,13 @@ public FileDownloadProperties() {
downloadMaxNetworkThreadCount = p.getProperty(KEY_DOWNLOAD_MAX_NETWORK_THREAD_COUNT);
}
} catch (IOException e) {
e.printStackTrace();
if (e instanceof FileNotFoundException) {
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(FileDownloadProperties.class, "not found filedownloader.properties");
}
} else {
e.printStackTrace();
}
} finally {
if (inputStream != null) {
try {

0 comments on commit fc0b38d

Please sign in to comment.