Check for non-existent folder in MockDownloader
This commit is contained in:
parent
a0288b8fd6
commit
eecfe09f2c
1 changed files with 11 additions and 9 deletions
|
@ -27,8 +27,9 @@ class MockDownloader extends Downloader {
|
||||||
public MockDownloader(@Nonnull String path) throws IOException {
|
public MockDownloader(@Nonnull String path) throws IOException {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.mocks = new HashMap<>();
|
this.mocks = new HashMap<>();
|
||||||
File folder = new File(path);
|
final File[] files = new File(path).listFiles();
|
||||||
for (File file : folder.listFiles()) {
|
if (files != null) {
|
||||||
|
for (File file : files) {
|
||||||
if (file.getName().startsWith(RecordingDownloader.FILE_NAME_PREFIX)) {
|
if (file.getName().startsWith(RecordingDownloader.FILE_NAME_PREFIX)) {
|
||||||
final FileReader reader = new FileReader(file);
|
final FileReader reader = new FileReader(file);
|
||||||
final TestRequestResponse response = new GsonBuilder()
|
final TestRequestResponse response = new GsonBuilder()
|
||||||
|
@ -39,6 +40,7 @@ class MockDownloader extends Downloader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response execute(@Nonnull Request request) {
|
public Response execute(@Nonnull Request request) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue