comparison src/luan/host/WebHandler.java @ 1763:164c6ea53147

fix change_password
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 22 May 2023 19:21:14 -0600
parents 07be5015159d
children 8df0b80e715e
comparison
equal deleted inserted replaced
1762:7d2297155ee3 1763:164c6ea53147
121 121
122 public static void removeHandler(String domain) { 122 public static void removeHandler(String domain) {
123 domainHandler.removeHandler(domain); 123 domainHandler.removeHandler(domain);
124 } 124 }
125 125
126 public static void moveTo(String domain,String toDomain,String password) throws LuanException, IOException {
127 toDomain = toDomain.toLowerCase();
128 File fromDir = new File(sitesDir,domain);
129 File toDir = new File(sitesDir,toDomain);
130 synchronized(domain) {
131 if( !fromDir.exists() )
132 throw new LuanException("domain not found");
133 if( toDir.exists() )
134 throw new LuanException("new_domain already exists");
135 callSite(domain,"close_lucene",password);
136 removeHandler(domain);
137 IoUtils.move(fromDir,toDir);
138 }
139 loadHandler(toDomain);
140 }
141
126 public static void loadHandler(String domain) throws LuanException { 142 public static void loadHandler(String domain) throws LuanException {
127 try { 143 try {
128 domainHandler.getHandler(domain); 144 domainHandler.getHandler(domain);
129 } catch(LuanRuntimeException e) { 145 } catch(LuanRuntimeException e) {
130 throw (LuanException)e.getCause(); 146 throw (LuanException)e.getCause();