mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
Remove dependency to commons-io
This commit is contained in:
parent
1ea6c6ce54
commit
e82cb1efea
@ -10,5 +10,4 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.13.1'
|
testImplementation 'junit:junit:4.13.1'
|
||||||
testImplementation "com.squareup.okhttp3:okhttp:3.12.11"
|
testImplementation "com.squareup.okhttp3:okhttp:3.12.11"
|
||||||
testImplementation 'com.google.code.gson:gson:2.8.6'
|
testImplementation 'com.google.code.gson:gson:2.8.6'
|
||||||
testImplementation 'commons-io:commons-io:2.8.0'
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package org.schabi.newpipe.downloader;
|
|||||||
|
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||||
import org.schabi.newpipe.extractor.downloader.Request;
|
import org.schabi.newpipe.extractor.downloader.Request;
|
||||||
import org.schabi.newpipe.extractor.downloader.Response;
|
import org.schabi.newpipe.extractor.downloader.Response;
|
||||||
@ -27,9 +26,13 @@ class RecordingDownloader extends Downloader {
|
|||||||
public RecordingDownloader(String stringPath) throws IOException {
|
public RecordingDownloader(String stringPath) throws IOException {
|
||||||
this.path = stringPath;
|
this.path = stringPath;
|
||||||
Path path = Paths.get(stringPath);
|
Path path = Paths.get(stringPath);
|
||||||
File directory = path.toFile();
|
File folder = path.toFile();
|
||||||
if (directory.exists()) {
|
if (folder.exists()) {
|
||||||
FileUtils.cleanDirectory(directory);
|
for (File file : folder.listFiles()) {
|
||||||
|
if (file.getName().startsWith(RecordingDownloader.FILE_NAME_PREFIX)) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Files.createDirectories(path);
|
Files.createDirectories(path);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user