@Test public void testGet() throws Exception { final Quota.Space quota = new SFTPQuotaFeature(session).get(); assertNotNull(quota.available); assertNotNull(quota.used); assertNotEquals(0L, quota.available, 0L); assertEquals(0L, quota.used, 0L); }
@Override public Space get() throws BackgroundException { final Path home = new SFTPHomeDirectoryService(session).find(); if(this.isSpaceAvailableExtensionAvailable()) { try { return this.getSpaceAvailable(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } if(this.isStatVFSOpenSSHSupported()) { try { return this.getSpaceStatVFSOpenSSH(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } return new Space(0L, Long.MAX_VALUE); }
SFTPQuotaFeature implements Quota { @Override public Space get() throws BackgroundException { final Path home = new SFTPHomeDirectoryService(session).find(); if(this.isSpaceAvailableExtensionAvailable()) { try { return this.getSpaceAvailable(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } if(this.isStatVFSOpenSSHSupported()) { try { return this.getSpaceStatVFSOpenSSH(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } return new Space(0L, Long.MAX_VALUE); } }
SFTPQuotaFeature implements Quota { @Override public Space get() throws BackgroundException { final Path home = new SFTPHomeDirectoryService(session).find(); if(this.isSpaceAvailableExtensionAvailable()) { try { return this.getSpaceAvailable(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } if(this.isStatVFSOpenSSHSupported()) { try { return this.getSpaceStatVFSOpenSSH(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } return new Space(0L, Long.MAX_VALUE); } SFTPQuotaFeature(final SFTPSession session); }
SFTPQuotaFeature implements Quota { @Override public Space get() throws BackgroundException { final Path home = new SFTPHomeDirectoryService(session).find(); if(this.isSpaceAvailableExtensionAvailable()) { try { return this.getSpaceAvailable(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } if(this.isStatVFSOpenSSHSupported()) { try { return this.getSpaceStatVFSOpenSSH(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } return new Space(0L, Long.MAX_VALUE); } SFTPQuotaFeature(final SFTPSession session); @Override Space get(); }
SFTPQuotaFeature implements Quota { @Override public Space get() throws BackgroundException { final Path home = new SFTPHomeDirectoryService(session).find(); if(this.isSpaceAvailableExtensionAvailable()) { try { return this.getSpaceAvailable(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } if(this.isStatVFSOpenSSHSupported()) { try { return this.getSpaceStatVFSOpenSSH(session.sftp(), home); } catch(BackgroundException e) { log.info(String.format("Failure obtaining disk quota. %s", e)); } } return new Space(0L, Long.MAX_VALUE); } SFTPQuotaFeature(final SFTPSession session); @Override Space get();  }