Package org.apache.commons.vfs2

Examples of org.apache.commons.vfs2.FileSystemOptions


{
    private final static int NUOF_RESOLVES = 100000;

    public static void main(String[] args) throws FileSystemException
    {
        FileSystemManager mgr = VFS.getManager();

        FileObject root = mgr
                .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
        FileName rootName = root.getName();

        testNames(mgr, rootName);
View Full Code Here


        {
            "/file1",
            "/file2",
        };

        FileSystemOptions opts = new FileSystemOptions();
        DelegatingFileSystemOptionsBuilder delgate = new DelegatingFileSystemOptionsBuilder(fsm);

        delgate.setConfigString(opts, "http", "proxyHost", "proxy");
        delgate.setConfigString(opts, "http", "proxyPort", "8080");
        delgate.setConfigClass(opts, "sftp", "userinfo", TrustEveryoneUserInfo.class);
View Full Code Here

        }
    }

    public void testDelegatingBad() throws Throwable
    {
        FileSystemOptions opts = new FileSystemOptions();
        DelegatingFileSystemOptionsBuilder delgate = new DelegatingFileSystemOptionsBuilder(fsm);

        try
        {
            delgate.setConfigString(opts, "http", "proxyPort", "wrong_port");
View Full Code Here

     */
    @Override
    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        final String uri = System.getProperty(TEST_URI);
        FileSystemOptions opts = new FileSystemOptions();
        FtpFileSystemConfigBuilder.getInstance().setPassiveMode(opts, true);
        return manager.resolveFile(uri, opts);
    }
View Full Code Here

     *
     */
    public void testVersioning() throws Exception
    {
        FileObject scratchFolder = createScratchFolder();
        FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
        WebdavFileSystemConfigBuilder builder =
            (WebdavFileSystemConfigBuilder)getManager().getFileSystemConfigBuilder("webdav");
        builder.setVersioning(opts, true);
        FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
        FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
        assertTrue(opts == newOpts);
        assertTrue(builder.isVersioning(newOpts));
        assertTrue(!file.exists());
        file.createFile();
        assertTrue(file.exists());
View Full Code Here

     *
     */
    public void testVersioningWithCreator() throws Exception
    {
        FileObject scratchFolder = createScratchFolder();
        FileSystemOptions opts = scratchFolder.getFileSystem().getFileSystemOptions();
        WebdavFileSystemConfigBuilder builder =
            (WebdavFileSystemConfigBuilder)getManager().getFileSystemConfigBuilder("webdav");
        builder.setVersioning(opts, true);
        builder.setCreatorName(opts, "testUser");
        FileObject file = getManager().resolveFile(scratchFolder, "file1.txt", opts);
        FileSystemOptions newOpts = file.getFileSystem().getFileSystemOptions();
        assertTrue(opts == newOpts);
        assertTrue(builder.isVersioning(newOpts));
        assertTrue(!file.exists());
        file.createFile();
        assertTrue(file.exists());
View Full Code Here

        throws Exception
    {
        WebdavFileSystemConfigBuilder builder =
            (WebdavFileSystemConfigBuilder)manager.getFileSystemConfigBuilder("webdav");
        final String uri = System.getProperty(TEST_URI);
        FileSystemOptions opts = new FileSystemOptions();
        builder.setRootURI(opts, uri);
        return manager.resolveFile(uri, opts);
    }
View Full Code Here

    @Override
    public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
    {
        final String uri = System.getProperty(TEST_URI);

        FileSystemOptions fileSystemOptions = new FileSystemOptions();
        SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fileSystemOptions, "no");
        SftpFileSystemConfigBuilder.getInstance().setUserInfo(fileSystemOptions, new TrustEveryoneUserInfo());

        return manager.resolveFile(uri, fileSystemOptions);
    }
View Full Code Here

    {
        FileSystemManager manager = VFS.getManager();
        FileName file = manager.resolveURI(fileName);
        FileName base = file.getParent();
        FileName path = manager.resolveName(base, file.getBaseName());
        FileSystemOptions opts = new FileSystemOptions();
        return manager.resolveFile(path.getURI(), opts);
    }
View Full Code Here

    protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        // Create the file system
        final GenericFileName rootName = (GenericFileName) name;
        FileSystemOptions fsOpts = (fileSystemOptions == null) ? new FileSystemOptions() : fileSystemOptions;

        UserAuthenticationData authData = null;
        HttpClient httpClient;
        try
        {
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs2.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.