/*
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.fresh.shell.impl;
import org.jboss.fresh.shell.ExecutableRegistry;
import org.jboss.fresh.shell.Executable;
import org.jboss.fresh.shell.commands.CDExe;
import org.jboss.fresh.shell.commands.SetCommand;
import org.jboss.fresh.shell.commands.RunExe;
import org.jboss.fresh.shell.commands.LsExe;
import org.jboss.fresh.shell.commands.CatExe;
import org.jboss.fresh.shell.commands.MkDirExe;
import org.jboss.fresh.shell.commands.LnExe;
import org.jboss.fresh.shell.commands.TouchExe;
import org.jboss.fresh.shell.commands.RmExe;
import org.jboss.fresh.shell.commands.SetAttrExe;
import org.jboss.fresh.shell.commands.InfoExe;
import org.jboss.fresh.shell.commands.CpExe;
import org.jboss.fresh.shell.commands.MvExe;
import org.jboss.fresh.shell.commands.EchoExe;
import org.jboss.fresh.shell.commands.PosExe;
import org.jboss.fresh.shell.commands.LsLnsExe;
import org.jboss.fresh.shell.commands.SetFileFieldExe;
/**
* @author <a href="mailto:ales.justin@jboss.org">Ales Justin</a>
*/
public class DefaultExecutableRegistry implements ExecutableRegistry
{
public Executable getExecutable(String command)
{
if ("cd".equals(command)) {
return new CDExe();
} else if ("set".equals(command)) {
return new SetCommand();
} else if ("run".equals(command)) {
return new RunExe();
} else if ("ls".equals(command)) {
return new LsExe();
} else if ("dir".equals(command)) {
return new LsExe();
} else if ("cat".equals(command)) {
return new CatExe();
} else if ("mkdir".equals(command)) {
return new MkDirExe();
} else if ("ln".equals(command)) {
return new LnExe();
} else if ("touch".equals(command)) {
return new TouchExe();
} else if ("rm".equals(command)) {
return new RmExe();
} else if ("setattr".equals(command)) {
return new SetAttrExe();
} else if ("info".equals(command)) {
return new InfoExe();
} else if ("cp".equals(command)) {
return new CpExe();
} else if ("mv".equals(command)) {
return new MvExe();
} else if ("echo".equals(command)) {
return new EchoExe();
} else if ("pos".equals(command)) {
return new PosExe();
} else if ("lslns".equals(command)) {
return new LsLnsExe();
} else if ("setffld".equals(command)) {
return new SetFileFieldExe();
} else {
return null;
}
}
}