Package org.apache.commons.vfs.auth

Examples of org.apache.commons.vfs.auth.StaticUserAuthenticator


    final String normalizedUrl = normalizeURL(loginData.getUrl(), version);
    final FileSystemOptions fileSystemOptions = new FileSystemOptions();
    final PentahoSolutionsFileSystemConfigBuilder configBuilder = new PentahoSolutionsFileSystemConfigBuilder();
    configBuilder.setTimeOut(fileSystemOptions, getTimeout(loginData) * 1000);
    configBuilder.setUserAuthenticator(fileSystemOptions, new StaticUserAuthenticator(normalizedUrl,
        loginData.getUsername(), loginData.getPassword()));
    return fileSystemManager.resolveFile(normalizedUrl, fileSystemOptions);
  }
View Full Code Here


        IRODSFileSystemConfigBuilder.getInstance().setZone(opts, "dummyZone");
        IRODSFileSystemConfigBuilder.getInstance().setUseLocalConfig(opts, false); // true by default.
        // ** Purposfully miss-out line below (default storage resource is required
        // information in order to authenticate using encrypt1). **
        //SrbFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, "ads-cache-srb");
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, "dummy", "dummyPass");
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

        try {
            // should throw FileSysten exception as insufficient info was given to authenticate
            // to the srb using encrypt1 (therefore, no actual attempt at
View Full Code Here

        SRBFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
        SRBFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        // ** Purposfully miss-out line below (default storage resource is required
        // information in order to authenticate using encrypt1). **
        //SrbFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, "ads-cache-srb");    
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, "dummy", "dummyPass");
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

        try {
            // should throw FileSysten exception as insufficient info was given to authenticate
            // to the srb using encrypt1 (therefore, no actual attempt at
View Full Code Here

        SRBFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, "dummyMdas");
        SRBFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
        SRBFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        SRBFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, "ads-cache-srb");    
        //
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, null, null);
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

        try {
            // should throw FileSysten exception as insufficient info was given to authenticate
            // to the srb using encrypt1 (therefore, no actual attempt at
View Full Code Here

        SRBFileSystemConfigBuilder.getInstance().setMcatZone(opts, this.srbEncryptMcatZone);
        SRBFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, this.srbEncryptDefaultResource);
        //SRBFileSystemConfigBuilder.getInstance().setQueryTimeout(opts, this.srbQueryTimeout);
        //SrbFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        //SrbFileSystemConfigBuilder.getInstance().setMdasUserInfoDirectory(opts, "infodir");
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, this.srbEncryptUsername, this.srbEncryptPassword);
        //DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);
        SRBFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);
        FileObject fo1 = fsManager.resolveFile(uri, opts);
        String homeDir = (String) fo1.getFileSystem().getAttribute(SRBVfsFileSystem.HOME_DIRECTORY);
        System.out.println("HOME_DIRECTORY: " + homeDir);
View Full Code Here

        // if you set the sftp path (e.g. /tmp) and also setUserDirIsRoot(opts, true)
        // then exceptions are thrown by the sftp impl (bug)!
        //SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(defaultOpts, true); // null by default.
        //Boolean byDef = SftpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(defaultOpts);

        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, this.sftpUsername, this.sftpPassword); //domain, user, pass
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(defaultOpts, auth);
        FileObject relativeToFO_ = fsManager.resolveFile(sftpUri, defaultOpts);
        // cant getAttributes with sftp FS, thus are unable to get home dir !

        return relativeToFO_;
View Full Code Here

        //
        FileSystemOptions opts = new FileSystemOptions();
        IRODSFileSystemConfigBuilder.getInstance().setHomeDirectory(opts, this.irodsEncryptHomeDirectory);
        IRODSFileSystemConfigBuilder.getInstance().setZone(opts, this.irodsEncryptZone);
        IRODSFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, this.irodsEncryptResource);
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, this.irodsEncryptUsername, this.irodsEncryptPassword);
        IRODSFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);
        FileObject fo1 = fsManager.resolveFile(uri, opts);
        String homeDir = (String) fo1.getFileSystem().getAttribute(IRODSVfsFileSystem.HOME_DIRECTORY);
        System.out.println("HOME_DIRECTORY: " + homeDir);
        FileObject relativeToFO_ = fsManager.resolveFile(uri + homeDir, opts);
View Full Code Here

        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
        SrbFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        // ** Purposfully miss-out line below (default storage resource is required
        // information in order to authenticate using encrypt1). **
        //SrbFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, "ads-cache-srb");    
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, "dummy", "dummyPass");
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

        try {
            // should throw FileSysten exception as insufficient info was given to authenticate
            // to the srb using encrypt1 (therefore, no actual attempt at
View Full Code Here

        SrbFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, "dummyMdas");
        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
        SrbFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        SrbFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, "ads-cache-srb");    
        //
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, null, null);
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);

        try {
            // should throw FileSysten exception as insufficient info was given to authenticate
            // to the srb using encrypt1 (therefore, no actual attempt at
View Full Code Here

        SrbFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, this.srbEncryptMdasDomainName);
        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, this.srbEncryptMcatZone);
        SrbFileSystemConfigBuilder.getInstance().setDefaultStorageResource(opts, this.srbEncryptDefaultResource);
        //SrbFileSystemConfigBuilder.getInstance().setUseLocalMdasFiles(opts, false); // true by default.
        //SrbFileSystemConfigBuilder.getInstance().setMdasUserInfoDirectory(opts, "infodir");
        StaticUserAuthenticator auth = new StaticUserAuthenticator(null, this.srbEncryptUsername, this.srbEncryptPassword);
        DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);
        FileObject fo1 = fsManager.resolveFile(uri, opts);
        String homeDir = (String) fo1.getFileSystem().getAttribute(SrbFileSystem.HOME_DIRECTORY);
        System.out.println("HOME_DIRECTORY: " + homeDir);
        FileObject relativeToFO_ = fsManager.resolveFile(uri + homeDir, opts);
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.auth.StaticUserAuthenticator

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.