Copy the shipped Locales on Startup to DATA/LOCALES

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@180 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent f57d280afd
commit 8796987def

@ -260,6 +260,21 @@ public final class yacy {
serverSystem.openBrowser("http://localhost:" + port + "/" + browserPopUpPage, browserPopUpApplication);
}
//Copy the shipped locales into DATA
File localesPath = new File(sb.getRootPath(), sb.getConfig("localesPath", "DATA/LOCALES"));
File defaultLocalesPath = new File(sb.getRootPath(), "locales");
try{
File[] defaultLocales = defaultLocalesPath.listFiles();
localesPath.mkdirs();
for(int i=0;i < defaultLocales.length; i++){
if(defaultLocales[i].getName().endsWith(".lng"))
serverFileUtils.copy(defaultLocales[i], new File(localesPath, defaultLocales[i].getName()));
}
}catch(NullPointerException e){
serverLog.logError("STARTUP", "Nullpointer Exception while copying the default Locales");
}
// registering shutdown hook
serverLog.logSystem("STARTUP", "Registering Shutdown Hook");
Runtime run = Runtime.getRuntime();

Loading…
Cancel
Save