Hello,

I've been trying to access to an SFTP server to download a 500MB file using VFS v1 and I'm always getting a Java heap space error (even after increasing the memory for the JVM). Because of that I'm using VFS v2 now but at the moment it tries to get the InputStream to start reading the file it gets stuck, it's not able to get the InputStream, no matter the size of the file, it's getting stucked with big file or very small files. If I use version 1 I can get the InputStream but I get the Java heap space error, but with version 2 I'm not even able to get the InputStream.
As I said, I'm using VFS 2 and jsch 0.1.44.

These are the lines of code:

DefaultFileSystemManager manager = new StandardFileSystemManager();
manager.setCacheStrategy(CacheStrategy.MANUAL);
manager.init();
FileSystemOptions options = new FileSystemOptions();
SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(options, "no"); SftpFileObject ftpFile = (SftpFileObject) manager.resolveFile(getXmlFullPath(fileName), options); Scanner in = new Scanner(new InputStreamReader(ftpFile.getInputStream(), StringStatics.CHARSET_UTF_8));

It gets stuck in the last line.

Thank you very much.

Kind regards,

Francisco Serrano.

--
Multicom Products Limited is a company registered in England and Wales 
(Registered Number 2447353 Wales) with its registered office at 33 Victoria 
Street, Bristol, BS1 6AS.

This email is confidential to the addressee and may contain privileged 
information.  If you have reason to believe that you are not the intended 
recipient of this communication, please delete it from your system and contact 
the sender immediately. You are not permitted to use or copy this email or its 
attachments nor may you disclose the same to any third party.  Unauthorised use 
or disclosure of this email is prohibited and may be unlawful.

We reserve the right to intercept and read emails sent or received by our 
employees. This is to ensure compliance with our internal policies and to 
protect our business. If you do not wish for your communications to be 
subjected to such scrutiny, you should not communicate via this email system.

We endeavour to exclude viruses and other malware from our data but it is the 
responsibility of the recipient to scan all emails and attachments for viruses 
before opening them. We accept no liability for any damage caused by any virus 
transmitted by this email.

Email may not be completely secure or error free, can be intercepted or 
corrupted and may arrive late or not at all. Anyone who communicates with us by 
email accepts these risks.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to