Overlay for welcome.*

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2299 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent a70cbd959b
commit ff39a7a0d1

@ -6,6 +6,7 @@ version 0.46
* ADDED: nice Errorpage for httpauth-fail. * ADDED: nice Errorpage for httpauth-fail.
* ADDED: support to generate gettext locales and parse them. * ADDED: support to generate gettext locales and parse them.
* CHANGED: new dirlisting support for empty directories instead of copying dir.* into 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 version 0.45
* UPDATED: new Design of search page * UPDATED: new Design of search page

@ -1,3 +1,4 @@
package www;
// welcome.java // welcome.java
// ----------------------- // -----------------------
// part of the AnomicHTTPD caching proxy // part of the AnomicHTTPD caching proxy

@ -50,7 +50,7 @@ public class migration {
//SVN constants //SVN constants
public static final int USE_WORK_DIR=1389; //wiki & messages in DATA/WORK 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 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) { public static void main(String[] args) {
} }
@ -64,7 +64,18 @@ public class migration {
if(fromRev < TAGDB_WITH_TAGHASH){ if(fromRev < TAGDB_WITH_TAGHASH){
migrateBookmarkTagsDB(sb); migrateBookmarkTagsDB(sb);
} }
if(fromRev < NEW_DIRLISTING_OVERLAY){ 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"); File file=new File(sb.htDocsPath, "share/dir.html");
if(file.exists()) if(file.exists())
file.delete(); file.delete();
@ -74,11 +85,15 @@ public class migration {
file=new File(sb.htDocsPath, "share/dir.java"); file=new File(sb.htDocsPath, "share/dir.java");
if(file.exists()) if(file.exists())
file.delete(); file.delete();
} file=new File(sb.htDocsPath, "www/welcome.html");
serverLog.logInfo("MIGRATION", "Migrating from "+String.valueOf(fromRev)+ " to "+String.valueOf(toRev)); if(file.exists())
installSkins(sb); file.delete();
migrate(sb); 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){ public static void installSkins(plasmaSwitchboard sb){
final File skinsPath = new File(sb.getRootPath(), sb.getConfig("skinsPath", "DATA/SKINS")); final File skinsPath = new File(sb.getRootPath(), sb.getConfig("skinsPath", "DATA/SKINS"));

@ -337,13 +337,6 @@ public final class yacy {
final File wwwDefaultPath = new File(htDocsPath, "www"); final File wwwDefaultPath = new File(htDocsPath, "www");
if (!(wwwDefaultPath.exists())) wwwDefaultPath.mkdir(); 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"); final File shareDefaultPath = new File(htDocsPath, "share");
if (!(shareDefaultPath.exists())) shareDefaultPath.mkdir(); if (!(shareDefaultPath.exists())) shareDefaultPath.mkdir();

Loading…
Cancel
Save