Package simpleserver.config

Examples of simpleserver.config.ReadFiles$docsFilter


    super("read DOCUMENT", "display a specified text document");
  }

  public void execute(Player player, String message) {
    String filename = extractArgument(message);
    ReadFiles d = player.getServer().docs;

    if (filename == null) {
      // no arguments given -> display list of available files

      StringBuilder s = new StringBuilder();
      for (String file : d.getList()) {
        s.append(file);
        s.append(", ");
      }
      if (s.length() > 2) {
        s.delete(s.length() - 2, s.length());
      }
      player.addTCaptionedMessage("Available text files", s.toString());
      return;
    }

    String text = d.getText(filename);
    if (text != null) {
      player.addTCaptionedMessage("Loaded document", filename);

      String[] textlines = text.split("\n");
      for (String l : textlines) {
View Full Code Here

TOP

Related Classes of simpleserver.config.ReadFiles$docsFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.