1

I'm downloading a file from the FTP server using the below

StandardFileSystemManager -> resolveFile and copyFrom(fileobject, Selectors.SELECT_SELF)

The local folders were created automatically and file has been successfully downloaded in LINUX machine.

When i executed the same operation in windows machine i got the following exception, because it is a relative path, and no base URI was provided

org.apache.commons.vfs.FileSystemException: Could not find file with URI "/mnt/shared/\test\sample\files\monday\34.csv" because it is a relative path, and no base URI was provided.

Could you please let me know your thought and suggestions?

Thanks, Kathir

Kathir
  • 497
  • 2
  • 6
  • 14

1 Answers1

0

Please specify your Windows path with forward slash as well. resolveFile() expects URIs not local files. You can use fo = manager.toFileObject(new File("test\\bla.txt")) instead of resolveFile if you insist on windows native (in this case relative) path.

eckes
  • 10,103
  • 1
  • 59
  • 71