Package org.apache.ftpserver.usermanager.impl

Examples of org.apache.ftpserver.usermanager.impl.WritePermission


            user.setMaxIdleTime(askForInt(in, "Max idle time in seconds (0 for none):"));
           
            List<Authority> authorities = new ArrayList<Authority>();
           
            if(askForBoolean(in, "Write permission (Y/N):")) {
                authorities.add(new WritePermission());
            }

            int maxLogins = askForInt(in, "Maximum number of concurrent logins (0 for no restriction)");
            int maxLoginsPerIp = askForInt(in, "Maximum number of concurrent logins per IP (0 for no restriction)");
           
View Full Code Here


            BaseUser user = new BaseUser();
            user.setName("admin");
            user.setPassword("admin");

            List<Authority> authorities = new ArrayList<Authority>();
            authorities.add( new WritePermission() );

            user.setAuthorities( authorities );

            user.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
View Full Code Here

  public TestUserManager(String homeDirectory) {
    super("admin", new ClearTextPasswordEncryptor());

    testUser = new BaseUser();
    testUser.setAuthorities(Arrays.asList(new Authority[] {new ConcurrentLoginPermission(1, 1), new WritePermission()}));
    testUser.setEnabled(true);
    testUser.setHomeDirectory(homeDirectory);
    testUser.setMaxIdleTime(10000);
    testUser.setName(TEST_USERNAME);
    testUser.setPassword(TEST_PASSWORD);
View Full Code Here

            userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
            UserManager um = userManagerFactory.createUserManager();

            if (createNewUsers) {
                List<Authority> auths = new ArrayList<Authority>();
                Authority auth = new WritePermission();
                auths.add(auth);

                BaseUser user = new BaseUser();
                user.setName("myNewUser");
                user.setPassword("secret");
View Full Code Here

*
*/
public class WritePermissionTest extends TestCase {

    public void testRootDir() throws Exception {
        WritePermission permission = new WritePermission("/");

        assertNotNull(permission.authorize(new WriteRequest("/")));
    }
View Full Code Here

        assertNotNull(permission.authorize(new WriteRequest("/")));
    }

    public void testDirs() throws Exception {
        WritePermission permission = new WritePermission("/bar");

        assertNull(permission.authorize(new WriteRequest("/foo")));
        assertNull(permission.authorize(new WriteRequest("/foo/bar")));
        assertNotNull(permission.authorize(new WriteRequest("/bar")));
        assertNotNull(permission.authorize(new WriteRequest("/bar/foo")));
    }
View Full Code Here

        user.setHomeDirectory("newhome");
        user.setEnabled(false);
        user.setMaxIdleTime(2);

        List<Authority> authorities = new ArrayList<Authority>();
        authorities.add(new WritePermission());
        authorities.add(new ConcurrentLoginPermission(3, 4));
        authorities.add(new TransferRatePermission(1, 5));
        user.setAuthorities(authorities);

        userManager.save(user);
View Full Code Here

        user.setHomeDirectory("newhome");
        user.setEnabled(false);
        user.setMaxIdleTime(2);

        List<Authority> authorities = new ArrayList<Authority>();
        authorities.add(new WritePermission());
        authorities.add(new ConcurrentLoginPermission(3, 4));
        authorities.add(new TransferRatePermission(1, 5));
        user.setAuthorities(authorities);

        userManager.save(user);
View Full Code Here

            user.setMaxIdleTime(askForInt(in, "Max idle time in seconds (0 for none):"));
           
            List<Authority> authorities = new ArrayList<Authority>();
           
            if(askForBoolean(in, "Write permission (Y/N):")) {
                authorities.add(new WritePermission());
            }

            int maxLogins = askForInt(in, "Maximum number of concurrent logins (0 for no restriction)");
            int maxLoginsPerIp = askForInt(in, "Maximum number of concurrent logins per IP (0 for no restriction)");
           
View Full Code Here

        user.setPassword("activemq");
        user.setHomeDirectory(ftpHomeDirFile.getParent());
       
        // authorize user
        List<Authority> auths = new ArrayList<Authority>();
        Authority auth = new WritePermission();
        auths.add(auth);
        user.setAuthorities(auths);
       
        userManager.save(user);
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.usermanager.impl.WritePermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.