comparison src/luan/host/Backup.java @ 1333:25746915a241

merge Luan and LuanState
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 12 Feb 2019 22:33:40 -0700
parents f41919741100
children 8b61c8c4e07a
comparison
equal deleted inserted replaced
1332:11b7e11f9ed5 1333:25746915a241
10 import org.slf4j.Logger; 10 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 11 import org.slf4j.LoggerFactory;
12 import org.apache.lucene.index.SnapshotDeletionPolicy; 12 import org.apache.lucene.index.SnapshotDeletionPolicy;
13 import org.apache.lucene.index.IndexCommit; 13 import org.apache.lucene.index.IndexCommit;
14 import org.apache.lucene.store.FSDirectory; 14 import org.apache.lucene.store.FSDirectory;
15 import luan.LuanState; 15 import luan.Luan;
16 import luan.LuanTable; 16 import luan.LuanTable;
17 import luan.LuanException; 17 import luan.LuanException;
18 import luan.modules.PackageLuan; 18 import luan.modules.PackageLuan;
19 import luan.modules.lucene.LuceneIndex; 19 import luan.modules.lucene.LuceneIndex;
20 import luan.host.Log4j; 20 import luan.host.Log4j;
59 if( !new File(from,"site/init.luan").exists() ) { 59 if( !new File(from,"site/init.luan").exists() ) {
60 return; 60 return;
61 } 61 }
62 String fromPath = from.getCanonicalPath() + "/"; 62 String fromPath = from.getCanonicalPath() + "/";
63 LuanTable luceneInstances; 63 LuanTable luceneInstances;
64 LuanState luan = null; 64 Luan luan = null;
65 try { 65 try {
66 if( WebHandler.isServing() ) { 66 if( WebHandler.isServing() ) {
67 luceneInstances = (LuanTable)WebHandler.runLuan( from.getName(), getLucenes, "getLucenes" ); 67 luceneInstances = (LuanTable)WebHandler.runLuan( from.getName(), getLucenes, "getLucenes" );
68 } else { 68 } else {
69 luan = new LuanState(); 69 luan = new Luan();
70 luan.onClose = new LuanState.OnClose() { 70 luan.onClose = new Luan.OnClose() {
71 private final List<Closeable> onClose = new ArrayList<Closeable>(); 71 private final List<Closeable> onClose = new ArrayList<Closeable>();
72 72
73 public void onClose(Closeable c) { 73 public void onClose(Closeable c) {
74 onClose.add(c); 74 onClose.add(c);
75 } 75 }