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: 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

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

@ -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");

@ -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();

Loading…
Cancel
Save