Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSystemOptions


        String uri = "irods://" + this.irodsEncryptHost + ":" + this.irodsEncryptPort;
        System.out.println("connection uri: " + uri);

        //
        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);
View Full Code Here


        assertNotNull(this.irodsGsiPort);
        assertNotNull(this.irodsGsiZone);

        String uri = "irods://" + this.irodsGsiHost + ":" + this.irodsGsiPort;
        //
        FileSystemOptions opts = new FileSystemOptions();
        IRODSFileSystemConfigBuilder.getInstance().setZone(opts, this.irodsGsiZone);

        IRODSFileSystemConfigBuilder.getInstance().setGSSCredential(opts,  cred);
        FileObject fo1 = fsManager.resolveFile(uri, opts);
View Full Code Here

   
    //@Test
    public void testCopyFrom() throws Exception {
        String srbGsiUri = "srb://" + srbGsiHost + ":" + srbGsiPort+"/ngs/home/david-meredith.ngs/test.txt";
        DefaultFileSystemManager fsManager = this.getFsManager()
        FileSystemOptions opts = this.createFileSystemOptions();
        FileObject to = fsManager.resolveFile(srbGsiUri, opts);
        assertTrue(to.exists());
       
        String localFile = "file:///tmp/from.txt";
        FileObject from = fsManager.resolveFile(localFile);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        this.loadProperties();
        //this.setupDefaultFileObjectFileSystemManager();
        this.fsManager = this.getFsManager();
        this.defaultOpts = new FileSystemOptions();
    }
View Full Code Here

    @Test
    public void testSetuptFileSystemManagerUsingMissingStaticUserAuthenticatorInfo() throws Exception {
        String uri = "srb://dummy.esc.rl.ac.uk:7510";
        fsManager = VFSUtil.createNewFsManager(true, true, true, true, true, true, null);
        FileSystemOptions opts = new FileSystemOptions();
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMin(opts, srbGsiPortMin);
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMax(opts, srbGsiPortMax);
        SrbFileSystemConfigBuilder.getInstance().setHomeDirectory(opts, "/dummy/home/dir/for/test");
        SrbFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, "dummyMdas");
        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
View Full Code Here

   
    //@Test
    public void testSetuptFileSystemManagerUsingMissingStaticUserAuthenticatorInfo2() throws Exception {
        String uri = "srb://dummy.esc.rl.ac.uk:7510";
        fsManager = VFSUtil.createNewFsManager(true, true, true, true, true, true, null);
        FileSystemOptions opts = new FileSystemOptions();
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMin(opts, srbGsiPortMin);
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMax(opts, srbGsiPortMax);
        SrbFileSystemConfigBuilder.getInstance().setHomeDirectory(opts, "/dummy/home/dir/for/test");
        SrbFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, "dummyMdas");
        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, "dummyZone");
View Full Code Here

        assertNotNull(this.cred);
        assertNotNull(this.srbGsiPortMin);
        assertNotNull(this.srbGsiPortMax);
        assertNotNull(this.srbGsiDefaultResource);

        FileSystemOptions options1 = new FileSystemOptions();
        SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(options1, "no");
        GridFtpFileSystemConfigBuilder.getInstance().setGSSCredential(options1, cred);
        //GridFtpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(options, true);

        SrbFileSystemConfigBuilder.getInstance().setGSSCredential(options1, cred);
View Full Code Here

        assertNotNull(this.srbEncryptDefaultResource);
        assertNotNull(this.srbEncryptUsername);
        assertNotNull(this.srbEncryptUsername);
        String uri = "srb://" + this.srbEncryptHost + ":" + this.srbEncryptPort;
        //
        FileSystemOptions opts = new FileSystemOptions();
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMin(opts, this.srbEncryptPortMin);
        SrbFileSystemConfigBuilder.getInstance().setFileWallPortMax(opts, this.srbEncryptPortMax);
        SrbFileSystemConfigBuilder.getInstance().setHomeDirectory(opts, this.srbEncryptHomeDirectory);
        SrbFileSystemConfigBuilder.getInstance().setMdasDomainName(opts, this.srbEncryptMdasDomainName);
        SrbFileSystemConfigBuilder.getInstance().setMcatZone(opts, this.srbEncryptMcatZone);
View Full Code Here

    protected FileObject setupSrbFileObjectGsiAuth(DefaultFileSystemManager fsManager) throws Exception {
        assertNotNull(this.srbGsiHost);
        assertNotNull(this.srbGsiPort);
        String srbGsiUri = "srb://" + srbGsiHost + ":" + srbGsiPort;
        FileSystemOptions opts = this.createFileSystemOptions();
        FileObject fo1 = fsManager.resolveFile(srbGsiUri, opts);
        String homeDir = (String) fo1.getFileSystem().getAttribute(SrbFileSystem.HOME_DIRECTORY);
        System.out.println("HOME_DIRECTORY: " + homeDir);
        // important, if a new uri was passed below (even same uri but with embedded
        // username and password), then a new filesystem would be created !
View Full Code Here

        return this.setupGridFtpFileObjectGsiAuth(fsManager, gridftpUri);
    }

    private FileObject setupGridFtpFileObjectGsiAuth(DefaultFileSystemManager fsManager, String gridftpUri) throws Exception {
        //String gridftpUri = "gsiftp://" + gridftpHost + ":" + gridftpPort;
        FileSystemOptions opts = this.createFileSystemOptions();
        FileObject fo1 = fsManager.resolveFile(gridftpUri, opts);
        String homeDir = (String) fo1.getFileSystem().getAttribute(GridFtpFileSystem.HOME_DIRECTORY); //getAttribute("HOME_DIRECTORY");
        System.out.println("HOME_DIRECTORY: " + homeDir);
        FileObject relativeToFO_ = fsManager.resolveFile(gridftpUri + homeDir, opts);
        assertEquals(FileType.FOLDER, relativeToFO_.getType());
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.FileSystemOptions

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.