@Test public void testUserOwnerIdentification() { final MantaSession ownerSession = new MantaSession( new Host( new MantaProtocol(), null, 443, new Credentials("theOwner")), new DisabledX509TrustManager(), new DefaultX509KeyManager()); assertTrue(ownerSession.userIsOwner()); final MantaSession subuserSession = new MantaSession( new Host( new MantaProtocol(), null, 443, new Credentials("theOwner/theSubUser")), new DisabledX509TrustManager(), new DefaultX509KeyManager()); assertFalse(subuserSession.userIsOwner()); }
protected boolean userIsOwner() { final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath()); return StringUtils.equals(host.getCredentials().getUsername(), account.getAccountOwner()); }
MantaSession extends HttpSession<MantaClient> { protected boolean userIsOwner() { final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath()); return StringUtils.equals(host.getCredentials().getUsername(), account.getAccountOwner()); } }
MantaSession extends HttpSession<MantaClient> { protected boolean userIsOwner() { final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath()); return StringUtils.equals(host.getCredentials().getUsername(), account.getAccountOwner()); } MantaSession(final Host host, final X509TrustManager trust, final X509KeyManager key); }
MantaSession extends HttpSession<MantaClient> { protected boolean userIsOwner() { final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath()); return StringUtils.equals(host.getCredentials().getUsername(), account.getAccountOwner()); } MantaSession(final Host host, final X509TrustManager trust, final X509KeyManager key); @Override void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel); @Override @SuppressWarnings("unchecked") T _getFeature(final Class<T> type); }
MantaSession extends HttpSession<MantaClient> { protected boolean userIsOwner() { final MantaAccountHomeInfo account = new MantaAccountHomeInfo(host.getCredentials().getUsername(), host.getDefaultPath()); return StringUtils.equals(host.getCredentials().getUsername(), account.getAccountOwner()); } MantaSession(final Host host, final X509TrustManager trust, final X509KeyManager key); @Override void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel); @Override @SuppressWarnings("unchecked") T _getFeature(final Class<T> type);  }