/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/web/BanListener.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/web/BanListener.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1934 by torben, Mon May 28 14:32:53 2012 UTC revision 1935 by torben, Wed Mar 20 14:50:00 2013 UTC
# Line 1  Line 1 
1  package dk.thoerup.bukkit.hoeruputils.web;  package dk.thoerup.bukkit.hoeruputils.web;
2    
3  import java.io.File;  import java.io.IOException;
4  import java.text.SimpleDateFormat;  import java.text.SimpleDateFormat;
5  import java.util.Date;  import java.util.Date;
6  import java.util.Set;  
 import java.util.Map;  
 import org.bukkit.Location;  
 import org.bukkit.Server;  
7  import org.bukkit.OfflinePlayer;  import org.bukkit.OfflinePlayer;
8  import org.bukkit.entity.Player;  import org.bukkit.Server;
9  import org.bukkit.plugin.Plugin;  import org.bukkit.plugin.Plugin;
10    
11  import org.bukkit.configuration.Configuration;  import com.sun.net.httpserver.HttpExchange;
12    import com.sun.net.httpserver.HttpHandler;
13    
 /*import org.kokakiwi.apicraft.events.ApiEvent;  
 import org.kokakiwi.apicraft.events.ApiListener;*/  
 import de.codeinfection.quickwango.ApiBukkit.ApiBukkit;  
 import de.codeinfection.quickwango.ApiBukkit.ApiServer.*;  
14    
15    
16  @Controller( name = "bans", authenticate = false, serializer = "raw" )  public class BanListener implements HttpHandler {
 public class BanListener extends ApiController {  
17    
18          SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");          SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
19    
# Line 30  public class BanListener extends ApiCont Line 23  public class BanListener extends ApiCont
23          String cachedText = "";          String cachedText = "";
24    
25          public BanListener(Plugin plugin, Server server) {          public BanListener(Plugin plugin, Server server) {
                 super( new de.codeinfection.quickwango.Abstraction.Implementations.Bukkit.BukkitPlugin(plugin) );  
                 //super( new de.codeinfection.quickwango.ApiBukkit.Abstraction.Implementations.Bukkit.BukkitPlugin(plugin) );  
26    
27                  this.server = server;                  this.server = server;
28          }          }
# Line 44  public class BanListener extends ApiCont Line 35  public class BanListener extends ApiCont
35                  return format.format(d );                  return format.format(d );
36          }          }
37                    
38            
39            
40          @Override          @Override
41          public void defaultAction(ApiRequest request, ApiResponse response) {          public void handle(HttpExchange http) throws IOException {              
42  /*              if(!event.path[0].equalsIgnoreCase("webstatus")) {          /*              if(!event.path[0].equalsIgnoreCase("webstatus")) {
43                          return;                          return;
44                  }*/                  }*/
45    
# Line 62  public class BanListener extends ApiCont Line 55  public class BanListener extends ApiCont
55                                  text = cachedText;                                  text = cachedText;
56                          }                          }
57                  }                  }
                           
58    
 /*              event.setResponse(xml);  
                 event.setActionTaken(true);*/  
59    
60                  response.setContent( text );                  http.getResponseBody().write( text.getBytes() );
61          }          }
62                    
63          private String buildText() {          private String buildText() {
# Line 93  public class BanListener extends ApiCont Line 83  public class BanListener extends ApiCont
83                                    
84          }          }
85    
86    
87    
88  }  }

Legend:
Removed from v.1934  
changed lines
  Added in v.1935

  ViewVC Help
Powered by ViewVC 1.1.20