Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8579529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:37:36+00:00 2026-06-11T20:37:36+00:00

I am trying to user the StaticUserAuthenticator with an FTP connection through ApacheVFS2 –

  • 0

I am trying to user the StaticUserAuthenticator with an FTP connection through ApacheVFS2 – I have the following code:

this.fsOptions = new FileSystemOptions();
StaticUserAuthenticator auth = new StaticUserAuthenticator(null, username, password); 
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(fsOptions, auth); 
this.fsManager = VFS.getManager();

// ... later

FileObject file = fsManager.resolveFile("ftp://myhost:21/pathtofile.ext".toString(), fsOptions);
FileContent content = file.getContent();

This results in the following exception being thrown:

org.apache.commons.vfs2.FileSystemException: Could not read file “ftp://myhost:21/pathtofile.ext”.
Caused by: sun.net.ftp.FtpLoginException: user anonymous : 501 Use user@site to connect via proxy

When I run a network trace on this I see that the user arg passed to the FTP server is ‘anonymous’
T 10.161.37.176:57650 -> 10.152.4.138:21 [AP]
USER anonymous..

Any idea what I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:37:37+00:00Added an answer on June 11, 2026 at 8:37 pm

    Ok, not as tricky as I thought

    UserAuthenticator auth = new StaticUserAuthenticator("", username, password); 
    DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(fsOptions, auth); 
    FtpFileSystemConfigBuilder.getInstance().setPassiveMode(fsOptions, true);
    

    Not sure if it’s the non-null first arg to the StaticUserAuthenticator constructor, or the passive mode that did it, but with those changes it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying retrieve user name from the code through graph api, the below
I'm trying to user MiddlemanApp to localize a website, following this http://middlemanapp.com/guides/localization guide. I
I'm trying to authenticate user accounts in Windows Phone. I found this C# library
I'm trying to prevent user from inserting * in a textbox. This is what
I'm trying to get user GUID from Active Directory. My code: DirectoryEntry entry =
I have been trying to user sharepoint designer to retrieve the user's full name
I'm a new ruby/rails user trying to get my mac set up for the
I am trying to user the Response.TransmitFile() to prompt a download. I have read
I'm trying to get user's country and continent, in VB.NET. I have searched a
I am a new jquery/js user trying to pass an argument from a selector

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.