From 8796987defc4fec5aa6b496fd8be0f0ff8a68a0b Mon Sep 17 00:00:00 2001 From: allo Date: Fri, 27 May 2005 08:36:07 +0000 Subject: [PATCH] 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 --- source/yacy.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/yacy.java b/source/yacy.java index 1b65b051d..c4991d222 100644 --- a/source/yacy.java +++ b/source/yacy.java @@ -259,6 +259,21 @@ public final class yacy { String browserPopUpApplication = sb.getConfig("browserPopUpApplication", "netscape"); 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");