Package org.apache.commons.vfs.provider

Examples of org.apache.commons.vfs.provider.GenericFileName


        return fileSystemOptions;
    }

    private FTPClient createClient() throws FileSystemException
    {
        final GenericFileName rootName = getRoot();

    UserAuthenticationData authData = null;
    try
    {
      authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, FtpFileProvider.AUTHENTICATOR_TYPES);

      return FtpClientFactory.createConnection(rootName.getHostName(),
        rootName.getPort(),
        UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())),
        UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())),
        rootName.getPath(),
        getFileSystemOptions());
    }
    finally
    {
      UserAuthenticatorUtils.cleanup(authData);
View Full Code Here


     */
    protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        // Create the file system
        final GenericFileName rootName = (GenericFileName) name;

        FTPClientWrapper ftpClient = new FTPClientWrapper(rootName, fileSystemOptions);
        /*
        FTPClient ftpClient = FtpClientFactory.createConnection(rootName.getHostName(),
            rootName.getPort(),
View Full Code Here

  private FileSystem createJCRFileSystem( final LayeredFileName genericRootName,
                                          final FileSystemOptions fileSystemOptions ) {
    UserAuthenticationData authData = null;
    try {
      authData = UserAuthenticatorUtils.authenticate( fileSystemOptions, AUTHENTICATOR_TYPES );
      final GenericFileName outerName = (GenericFileName) genericRootName.getOuterName();

      final String username = UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
        ( authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar( outerName.getUserName() ) ) );

      final String password = UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
        ( authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar( outerName.getPassword() ) ) );
      final PentahoSolutionsFileSystemConfigBuilder configBuilder = new PentahoSolutionsFileSystemConfigBuilder();
      final int timeOut = configBuilder.getTimeOut( fileSystemOptions );

      final JCRSolutionFileModel model = new JCRSolutionFileModel( outerName.getURI(), username, password, timeOut );
      return new JCRSolutionFileSystem( genericRootName, fileSystemOptions, model );
    } finally {
      UserAuthenticatorUtils.cleanup( authData );
    }
  }
View Full Code Here

  private FileSystem createWebFileSystem( final LayeredFileName genericRootName,
                                          final FileSystemOptions fileSystemOptions ) throws FileSystemException {
    UserAuthenticationData authData = null;
    try {
      authData = UserAuthenticatorUtils.authenticate( fileSystemOptions, AUTHENTICATOR_TYPES );
      final GenericFileName outerName = (GenericFileName) genericRootName.getOuterName();

      final HttpClient httpClient = HttpClientFactory.createConnection(
        outerName.getScheme(),
        outerName.getHostName(),
        outerName.getPort(),
        UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
          ( authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar( outerName.getUserName() ) ) ),
        UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
          ( authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar( outerName.getPassword() ) ) ),
        fileSystemOptions
      );

      httpClient.getParams().setAuthenticationPreemptive( true );
      final PentahoSolutionsFileSystemConfigBuilder configBuilder = new PentahoSolutionsFileSystemConfigBuilder();
      final int timeOut = configBuilder.getTimeOut( fileSystemOptions );
      httpClient.getParams().setSoTimeout( Math.max( 0, timeOut ) );

      return new WebSolutionFileSystem( genericRootName, fileSystemOptions,
        new LocalFileModel( outerName.getURI(), httpClient,
          outerName.getUserName(), outerName.getPassword() )
      );
    } finally {
      UserAuthenticatorUtils.cleanup( authData );
    }
  }
View Full Code Here

   * Creates an FTP client to use.
   */
  public GridFTPClient getClient() throws FileSystemException {
    synchronized (idleClientSync) {
      if (idleClient == null) {
        final GenericFileName rootName = (GenericFileName) getRoot()
            .getName();

        /*log.debug("Creating connection to GSIFTP Host: "
            + rootName.getHostName() + " Port:"
            + rootName.getPort() + " User:"
            + rootName.getUserName() + " Path: "
            + rootName.getPath());*/

        return GsiFtpClientFactory.createConnection(rootName
            .getHostName(), rootName.getPort(), rootName
            .getUserName(), rootName.getPassword(),
        // rootName.getPath(),
            getFileSystemOptions());
      } else {
        final GridFTPClient client = idleClient;
        idleClient = null;
View Full Code Here

     * Creates a {@link FileSystem}.
     */
    protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException
    {
        // Create the file system
        final GenericFileName rootName = (GenericFileName) name;

        //Session session;
        GridFTPClient client;
        String attr_home;
        try
        {
            log.debug("Creating connection to GsiFTP Host:" + rootName.getHostName()
                + " Port:" + rootName.getPort()
                + " User:" + rootName.getUserName()
                + " Path:" + rootName.getPath());
         
          client = GsiFtpClientFactory.createConnection(rootName.getHostName(),
                  rootName.getPort(),
                  rootName.getUserName(),
                  rootName.getPassword(),
                  fileSystemOptions);

            //go to the home for the user
            client.changeDir("~");
            attr_home = client.getCurrentDir();
View Full Code Here

   * Creates a filesystem.
   */
  protected FileSystem doCreateFileSystem(final FileName name,
      final FileSystemOptions fileSystemOptions) throws FileSystemException {
    // Create the file system
    final GenericFileName rootName = (GenericFileName) name;

    HttpClient httpClient = IvyWebdavClientFactory.createConnection(rootName.getHostName(),
        rootName.getPort(), rootName.getUserName(), rootName.getPassword(),
        fileSystemOptions);

    return new IvyWebdavFileSystem(rootName, httpClient, fileSystemOptions);
  }
View Full Code Here

     */
    protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        // Create the file system
        final GenericFileName rootName = (GenericFileName) name;

    UserAuthenticationData authData = null;
    HttpClient httpClient;
    try
    {
      authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, AUTHENTICATOR_TYPES);

      httpClient = WebdavClientFactory.createConnection(
        rootName.getHostName(),
        rootName.getPort(),
        UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())),
        UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())),
        fileSystemOptions);
    }
    finally
    {
      UserAuthenticatorUtils.cleanup(authData);
View Full Code Here

     * Creates a file object.  This method is called only if the requested
     * file is not cached.
     */
    protected FileObject createFile(final FileName name)
    {
        final GenericFileName fileName = (GenericFileName) name;
        return new WebdavFileObject(fileName, this);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.provider.GenericFileName

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.