@Test public void testUnconfirmedReadsNumber() { final SFTPWriteFeature feature = new SFTPWriteFeature(session); assertEquals(33, feature.getMaxUnconfirmedWrites(new TransferStatus().length(TransferStatus.MEGA * 1L))); assertEquals(64, feature.getMaxUnconfirmedWrites(new TransferStatus().length((long) (TransferStatus.GIGA * 1.3)))); }
protected int getMaxUnconfirmedWrites(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.write.maxunconfirmed"); } return Integer.min((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1, preferences.getInteger("sftp.write.maxunconfirmed")); }
SFTPWriteFeature extends AppendWriteFeature<Void> { protected int getMaxUnconfirmedWrites(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.write.maxunconfirmed"); } return Integer.min((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1, preferences.getInteger("sftp.write.maxunconfirmed")); } }
SFTPWriteFeature extends AppendWriteFeature<Void> { protected int getMaxUnconfirmedWrites(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.write.maxunconfirmed"); } return Integer.min((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1, preferences.getInteger("sftp.write.maxunconfirmed")); } SFTPWriteFeature(final SFTPSession session); }
SFTPWriteFeature extends AppendWriteFeature<Void> { protected int getMaxUnconfirmedWrites(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.write.maxunconfirmed"); } return Integer.min((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1, preferences.getInteger("sftp.write.maxunconfirmed")); } SFTPWriteFeature(final SFTPSession session); @Override StatusOutputStream<Void> write(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override boolean temporary(); @Override boolean random(); }
SFTPWriteFeature extends AppendWriteFeature<Void> { protected int getMaxUnconfirmedWrites(final TransferStatus status) { if(-1 == status.getLength()) { return preferences.getInteger("sftp.write.maxunconfirmed"); } return Integer.min((int) (status.getLength() / preferences.getInteger("connection.chunksize")) + 1, preferences.getInteger("sftp.write.maxunconfirmed")); } SFTPWriteFeature(final SFTPSession session); @Override StatusOutputStream<Void> write(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override boolean temporary(); @Override boolean random();  }