@Override
    public void run() {
        System.out.println("connection accepted");
        do {
            try {
                Object o = sktReader.readObject();
                if (o != null) {
                    if (o instanceof SocketCMD) {
                        cmd = (SocketCMD) o;
                        if (cmd.cmd.compareTo("getfile") == 0) {
                            System.out.println(cmd.cmd);
                            System.out.println(cmd.parameters[0]);
                            System.out.println(cmd.parameters[1]);
                            Socket fileSkt = new Socket(skt.getInetAddress(), Integer.parseInt(cmd.parameters[1]));
                            File f = new File(cmd.parameters[0]);
                            OutputStream out = fileSkt.getOutputStream();
                            InputStream in = new FileInputStream(f);
                            IOUtils.copy(in, out);
                            fileSkt.close();
                            in.close();
                            out.close();
                            skt.close();
                            skt = null;
                            break;
                        } else if (cmd.cmd.compareTo("bye") == 0) {
                            skt.close();
                            skt = null;
                            break;
                        }
                    } else {
                        Thread.sleep(500);
                    }
                }
            } catch (IOException ex) {
                Logger.getLogger(BugNERISNetworkFooCmdProcessor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InterruptedException ex) {
                Logger.getLogger(BugNERISNetworkFooCmdProcessor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(BugNERISNetworkFooCmdProcessor.class.getName()).log(Level.SEVERE, null, ex);
            }
        } while (skt != null);
    }