yacy_search_server/source/de/anomic/yacy/seedUpload/yacySeedUploadFile.java
theli 0e1d9e9722 *) shrinking httpc linebuffer when httpc is returned to pool. This is done to free memory
*) 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
2005-05-23 10:10:51 +00:00

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[]{};
}
}