public void sendFile(String path){
        FileInputStream fin = null;
        try {
            File transferFile = new File (path);
            byte [] bytearray  = new byte [(int)transferFile.length()];
            fin = new FileInputStream(transferFile);
            BufferedInputStream bin = new BufferedInputStream(fin);
            bin.read(bytearray,0,bytearray.length);
            OutputStream os = socket.getOutputStream();
            System.out.println("Sending Files...");
            os.write(bytearray,0,bytearray.length);
            os.flush();
            socket.close();
            System.out.println("File transfer complete");
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
        }
        catch (IOException ex) {
                Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
        }finally {
            try {
                fin.close();
            } catch (IOException ex) {
                Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }