@Test public void testUnconfirmedReadsNumber() { final SFTPReadFeature feature = new SFTPReadFeature(session); assertEquals(33, feature.getMaxUnconfirmedReads(new TransferStatus().length(TransferStatus.MEGA * 1L))); assertEquals(64, feature.getMaxUnconfirmedReads(new TransferStatus().length((long) (TransferStatus.GIGA * 1.3)))); }
protected int getMaxUnconfirmedReads(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.read.maxunconfirmed"); } return Integer.min(((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1), preferences.getInteger("sftp.read.maxunconfirmed")); }
SFTPReadFeature implements Read { protected int getMaxUnconfirmedReads(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.read.maxunconfirmed"); } return Integer.min(((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1), preferences.getInteger("sftp.read.maxunconfirmed")); } }
SFTPReadFeature implements Read { protected int getMaxUnconfirmedReads(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.read.maxunconfirmed"); } return Integer.min(((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1), preferences.getInteger("sftp.read.maxunconfirmed")); } SFTPReadFeature(final SFTPSession session); }
SFTPReadFeature implements Read { protected int getMaxUnconfirmedReads(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.read.maxunconfirmed"); } return Integer.min(((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1), preferences.getInteger("sftp.read.maxunconfirmed")); } SFTPReadFeature(final SFTPSession session); @Override InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override boolean offset(final Path file); }
SFTPReadFeature implements Read { protected int getMaxUnconfirmedReads(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.read.maxunconfirmed"); } return Integer.min(((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1), preferences.getInteger("sftp.read.maxunconfirmed")); } SFTPReadFeature(final SFTPSession session); @Override InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override boolean offset(final Path file);  }