mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 21:39:47 +00:00
DownloadVoiceData.java: Move clearContents to the AsyncExtract inner class.
This commit is contained in:
@@ -78,22 +78,6 @@ public class DownloadVoiceData extends Activity {
|
||||
mAsyncExtract.cancel(true);
|
||||
}
|
||||
|
||||
private static void clearContents(File directory) {
|
||||
if (!directory.exists() || !directory.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final File[] children = directory.listFiles();
|
||||
|
||||
for (File child : children) {
|
||||
if (child.isDirectory()) {
|
||||
clearContents(child);
|
||||
}
|
||||
|
||||
child.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AsyncExtract extends AsyncTask<Void, Void, Integer> {
|
||||
private final LinkedList<File> mExtractedFiles = new LinkedList<File>();
|
||||
|
||||
@@ -197,5 +181,21 @@ public class DownloadVoiceData extends Activity {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void clearContents(File directory) {
|
||||
if (!directory.exists() || !directory.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final File[] children = directory.listFiles();
|
||||
|
||||
for (File child : children) {
|
||||
if (child.isDirectory()) {
|
||||
clearContents(child);
|
||||
}
|
||||
|
||||
child.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user