mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
0e1d9e9722
*) Making Seed-Upload configuration more verbose. *) Some Changes in SOAP Search API (not finished yet). git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@158 6c8d7289-2bf4-0310-a012-ef5d649a1542
39 lines
1.3 KiB
Java
39 lines
1.3 KiB
Java
package de.anomic.yacy.seedUpload;
|
|
|
|
import java.io.File;
|
|
import java.net.URL;
|
|
|
|
import de.anomic.server.serverFileUtils;
|
|
import de.anomic.server.serverSwitch;
|
|
import de.anomic.yacy.yacySeedDB;
|
|
import de.anomic.yacy.yacySeedUploader;
|
|
|
|
public class yacySeedUploadFile implements yacySeedUploader {
|
|
|
|
public static final String CONFIG_FILE_PATH = "seedFilePath";
|
|
|
|
public String uploadSeedFile(serverSwitch sb, yacySeedDB seedDB, File seedFile) throws Exception {
|
|
|
|
String logt, seedFilePath = "";
|
|
try {
|
|
seedFilePath = sb.getConfig(CONFIG_FILE_PATH,"");
|
|
if (seedFilePath.length() == 0) throw new Exception("Path to seed file is not configured properly");
|
|
|
|
File publicSeedFile = new File(seedFilePath);
|
|
serverFileUtils.copy(seedFile,publicSeedFile);
|
|
|
|
return "Seed-List file stored successfully";
|
|
} catch (Exception e) {
|
|
throw new Exception("Unable to store the seed-list file into the filesystem using path '" + seedFilePath + "'. " + e.getMessage());
|
|
}
|
|
}
|
|
|
|
public String[] getConfigurationOptions() {
|
|
return new String[]{CONFIG_FILE_PATH};
|
|
}
|
|
|
|
public String[] getLibxDependences() {
|
|
return new String[]{};
|
|
}
|
|
}
|