Woking file transfer with jruby. This code does not work with ruby 2.0 p247