Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package telnet;
- import java.util.logging.Logger;
- public class Alias {
- private static final Logger log = Logger.getLogger(Alias.class.getName());
- public Alias() {
- }
- public String parse(String line) throws StringIndexOutOfBoundsException {
- char c = line.charAt(0);
- String s = String.valueOf(c);
- if ("/".equals(s)) {
- line = getAlias(line);
- }
- return line;
- }
- private String getAlias(String line) {
- String sentence = line.subSequence(1, line.length()).toString();
- String[] words = sentence.split(" ");
- String action = words[0];
- String target = words[1];
- if ("t".equals(action)) {
- log.info("targetting correct\t\t" + target);
- }
- return "";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment