Now checks that URLHistory exists and that we can write to it before trying to write to it
This commit is contained in:
parent
d11dfe814b
commit
2977075a4b
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user