From ff39a7a0d1a879f44b10968151f27ee74f773335 Mon Sep 17 00:00:00 2001 From: allo Date: Tue, 18 Jul 2006 11:07:30 +0000 Subject: [PATCH] Overlay for welcome.* git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2299 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- ChangeLog | 1 + htroot/{htdocsdefault => www}/welcome.html | 0 htroot/{htdocsdefault => www}/welcome.java | 1 + source/migration.java | 37 +++++++++++++++------- source/yacy.java | 7 ---- 5 files changed, 28 insertions(+), 18 deletions(-) rename htroot/{htdocsdefault => www}/welcome.html (100%) rename htroot/{htdocsdefault => www}/welcome.java (97%) diff --git a/ChangeLog b/ChangeLog index cb77c4201..7d16f53e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ version 0.46 * ADDED: nice Errorpage for httpauth-fail. * ADDED: support to generate gettext locales and parse them. * CHANGED: new dirlisting support for empty directories instead of copying dir.* into them. + * CHANGED: do not copy welcome.* / dir.*. We use a overlay instead. version 0.45 * UPDATED: new Design of search page diff --git a/htroot/htdocsdefault/welcome.html b/htroot/www/welcome.html similarity index 100% rename from htroot/htdocsdefault/welcome.html rename to htroot/www/welcome.html diff --git a/htroot/htdocsdefault/welcome.java b/htroot/www/welcome.java similarity index 97% rename from htroot/htdocsdefault/welcome.java rename to htroot/www/welcome.java index 2aa7fe1ba..263ff2d76 100644 --- a/htroot/htdocsdefault/welcome.java +++ b/htroot/www/welcome.java @@ -1,3 +1,4 @@ +package www; // welcome.java // ----------------------- // part of the AnomicHTTPD caching proxy diff --git a/source/migration.java b/source/migration.java index 5befc912e..b0d60426a 100644 --- a/source/migration.java +++ b/source/migration.java @@ -50,7 +50,7 @@ public class migration { //SVN constants public static final int USE_WORK_DIR=1389; //wiki & messages in DATA/WORK public static final int TAGDB_WITH_TAGHASH=1635; //tagDB keys are tagHashes instead of plain tagname. - public static final int NEW_DIRLISTING_OVERLAY=2294; + public static final int NEW_OVERLAYS=2299; public static void main(String[] args) { } @@ -64,22 +64,37 @@ public class migration { if(fromRev < TAGDB_WITH_TAGHASH){ migrateBookmarkTagsDB(sb); } - if(fromRev < NEW_DIRLISTING_OVERLAY){ - File file=new File(sb.htDocsPath, "share/dir.html"); - if(file.exists()) - file.delete(); - file=new File(sb.htDocsPath, "share/dir.class"); - if(file.exists()) - file.delete(); - file=new File(sb.htDocsPath, "share/dir.java"); - if(file.exists()) - file.delete(); + if(fromRev < NEW_OVERLAYS){ + migrateDefaultFiles(sb); } serverLog.logInfo("MIGRATION", "Migrating from "+String.valueOf(fromRev)+ " to "+String.valueOf(toRev)); installSkins(sb); migrate(sb); } } + /* + * remove the static defaultfiles. We use them through a overlay now. + */ + public static void migrateDefaultFiles(plasmaSwitchboard sb){ + File file=new File(sb.htDocsPath, "share/dir.html"); + if(file.exists()) + file.delete(); + file=new File(sb.htDocsPath, "share/dir.class"); + if(file.exists()) + file.delete(); + file=new File(sb.htDocsPath, "share/dir.java"); + if(file.exists()) + file.delete(); + file=new File(sb.htDocsPath, "www/welcome.html"); + if(file.exists()) + file.delete(); + file=new File(sb.htDocsPath, "www/welcome.java"); + if(file.exists()) + file.delete(); + file=new File(sb.htDocsPath, "www/welcome.class"); + if(file.exists()) + file.delete(); + } public static void installSkins(plasmaSwitchboard sb){ final File skinsPath = new File(sb.getRootPath(), sb.getConfig("skinsPath", "DATA/SKINS")); final File defaultSkinsPath = new File(sb.getRootPath(), "skins"); diff --git a/source/yacy.java b/source/yacy.java index 949a34569..e2d42dc62 100644 --- a/source/yacy.java +++ b/source/yacy.java @@ -337,13 +337,6 @@ public final class yacy { final File wwwDefaultPath = new File(htDocsPath, "www"); if (!(wwwDefaultPath.exists())) wwwDefaultPath.mkdir(); - final File wwwDefaultClass = new File(wwwDefaultPath, "welcome.class"); - //if ((!(wwwDefaultClass.exists())) || (wwwDefaultClass.length() != (new File(htRootPath, "htdocsdefault/welcome.class")).length())) try { - if((new File(htRootPath, "htdocsdefault/welcome.java")).exists()) - serverFileUtils.copy(new File(htRootPath, "htdocsdefault/welcome.java"), new File(wwwDefaultPath, "welcome.java")); - serverFileUtils.copy(new File(htRootPath, "htdocsdefault/welcome.class"), wwwDefaultClass); - serverFileUtils.copy(new File(htRootPath, "htdocsdefault/welcome.html"), new File(wwwDefaultPath, "welcome.html")); - //} catch (IOException e) {} final File shareDefaultPath = new File(htDocsPath, "share"); if (!(shareDefaultPath.exists())) shareDefaultPath.mkdir();