|
|
|
@ -53,7 +53,13 @@ public class IndexImportMediawiki_p {
|
|
|
|
|
prop.put("import_status", 0);
|
|
|
|
|
} else {
|
|
|
|
|
if (post.containsKey("file")) {
|
|
|
|
|
final File sourcefile = new File(post.get("file"));
|
|
|
|
|
String file = post.get("file");
|
|
|
|
|
if (file.startsWith("file://")) file = file.substring(7);
|
|
|
|
|
if (file.startsWith("http")) {
|
|
|
|
|
prop.put("import_dump", "");
|
|
|
|
|
prop.put("import_thread", "Error: file argument must be a path to a document in the local file system");
|
|
|
|
|
} else {
|
|
|
|
|
final File sourcefile = new File(file);
|
|
|
|
|
if (sourcefile.exists()) {
|
|
|
|
|
MediawikiImporter.job = new MediawikiImporter(sourcefile, sb.surrogatesInPath);
|
|
|
|
|
MediawikiImporter.job.start();
|
|
|
|
@ -63,6 +69,7 @@ public class IndexImportMediawiki_p {
|
|
|
|
|
prop.put("import_dump", "");
|
|
|
|
|
prop.put("import_thread", "Error: file not found ["+sourcefile+"]");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
prop.put("import", 1);
|
|
|
|
|
prop.put("import_count", 0);
|
|
|
|
|
prop.put("import_speed", 0);
|
|
|
|
|