try {
raf = new RandomAccessFile(file, "r");
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
}
FileRegion fileRegion = null;
try {
assert raf != null;
fileRegion = new FileRegion(raf.getChannel(), 0, raf.length());
} catch (IOException e) {
e.printStackTrace();
}
session.write(fileRegion);
} else {