Examples of WritePermission


Examples of org.apache.ftpserver.usermanager.WritePermission

      propertiesUserManager.setPropFileftpUserPropertiesFile );
      BaseUser ftpUser = new BaseUser();
      ftpUser.setName( userName );
      ftpUser.setPassword( password );
      ftpUser.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
      Authority[] auths = { new WritePermission() };
      ftpUser.setAuthorities( auths );
          ftpUser.setEnabledtrue );
          propertiesUserManager.configure();
      propertiesUserManager.save( ftpUser );
     
View Full Code Here

Examples of org.apache.ftpserver.usermanager.WritePermission

      UserManager userManager = context.getUserManager();
      BaseUser adminUser = new BaseUser();
      adminUser.setName("admin");
      adminUser.setPassword("admin");
      adminUser.setEnabled(true);
      adminUser.setAuthorities(new Authority[] { new WritePermission() });

      Path adminUserHome = new Path(ftpServerRoot, "user/admin");
      adminUser.setHomeDirectory(adminUserHome.toUri().getPath());
      adminUser.setMaxIdleTime(0);
      userManager.save(adminUser);
View Full Code Here

Examples of org.apache.ftpserver.usermanager.WritePermission

      UserManager userManager = context.getUserManager();
      BaseUser adminUser = new BaseUser();
      adminUser.setName("admin");
      adminUser.setPassword("admin");
      adminUser.setEnabled(true);
      adminUser.setAuthorities(new Authority[] { new WritePermission() });

      Path adminUserHome = new Path(ftpServerRoot, "user/admin");
      adminUser.setHomeDirectory(adminUserHome.toUri().getPath());
      adminUser.setMaxIdleTime(0);
      userManager.save(adminUser);
View Full Code Here

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

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

            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

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

  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

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

            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

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

*
*/
public class WritePermissionTest extends TestCase {

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

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

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

        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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.