Ripme now makes config dir and url_history file if they do not exist
This commit is contained in:
parent
2977075a4b
commit
ef1cab60e1
@ -74,16 +74,25 @@ public abstract class AbstractRipper
|
||||
File file = new File(URLHistoryFile);
|
||||
if (!new File(Utils.getConfigDir()).exists()) {
|
||||
logger.error("Config dir doesn't exist");
|
||||
return;
|
||||
logger.info("Making config dir");
|
||||
boolean couldMakeDir = new File(Utils.getConfigDir()).mkdirs();
|
||||
if (!couldMakeDir) {
|
||||
logger.error("Couldn't make config dir");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if file doesnt exists, then create it
|
||||
if (!file.exists()) {
|
||||
boolean couldMakeDir = file.createNewFile();
|
||||
if (!couldMakeDir) {
|
||||
logger.error("Couldn't url history file");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!file.canWrite()) {
|
||||
logger.error("Can't write to url history file: " + URLHistoryFile);
|
||||
return;
|
||||
}
|
||||
// if file doesnt exists, then create it
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
}
|
||||
fw = new FileWriter(file.getAbsoluteFile(), true);
|
||||
bw = new BufferedWriter(fw);
|
||||
bw.write(downloadedURL);
|
||||
|
Loading…
Reference in New Issue
Block a user