mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-10 16:04:19 +02:00
Now checks that URLHistory exists and that we can write to it before trying to write to it
This commit is contained in:
@@ -72,6 +72,14 @@ public abstract class AbstractRipper
|
|||||||
FileWriter fw = null;
|
FileWriter fw = null;
|
||||||
try {
|
try {
|
||||||
File file = new File(URLHistoryFile);
|
File file = new File(URLHistoryFile);
|
||||||
|
if (!new File(Utils.getConfigDir()).exists()) {
|
||||||
|
logger.error("Config dir doesn't exist");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!file.canWrite()) {
|
||||||
|
logger.error("Can't write to url history file: " + URLHistoryFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// if file doesnt exists, then create it
|
// if file doesnt exists, then create it
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
|
Reference in New Issue
Block a user