JSch get() fails with NullPointerException
I've got a Jax-RS server which is supposed to keep a list of files accessible via ssh that I can then download or stream via HTTP. I've been trying to read the files with JSch's SFTP channel, but I keep receiving a NullPointerException . Here's the MessageBodyWriter I wrote: @Provider @Produces("video/*") public class MediaBodyWriter implements MessageBodyWriter<MediaFile> { @Override public long getSize(MediaFile mFile, Class<?> arg1, Type arg2, Annotation[] arg3, MediaType arg4) { return mFile.getFileSize(); } @Override public boolean isWriteable(Class<?> type, Type arg1, Annotation[] arg2,