Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 35798 invoked from network); 2 Mar 2008 04:36:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2008 04:36:03 -0000 Received: (qmail 6719 invoked by uid 500); 2 Mar 2008 04:35:57 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 6619 invoked by uid 500); 2 Mar 2008 04:35:57 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 6610 invoked by uid 99); 2 Mar 2008 04:35:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Mar 2008 20:35:57 -0800 X-ASF-Spam-Status: No, hits=-1998.0 required=10.0 tests=ALL_TRUSTED,URIBL_BLACK X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Mar 2008 04:35:22 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A055F234C083 for ; Sat, 1 Mar 2008 20:34:50 -0800 (PST) Message-ID: <1022530210.1204432490655.JavaMail.jira@brutus> Date: Sat, 1 Mar 2008 20:34:50 -0800 (PST) From: "Andrew Franklin (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (VFS-201) FTP is failing by saying "File doesn't exist" even the file exists and a valid file. In-Reply-To: <638682237.1204292212401.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/VFS-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574184#action_12574184 ] Andrew Franklin commented on VFS-201: ------------------------------------- You're setting an SFTP Property: SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no"); and connecting to an FTP server: "ftp://usename:password@ipaddress/home/blrproj/console.out" ... if your intention is to connect to an SFTP server, try: "sftp://usename:password@ipaddress/home/blrproj/console.out". > FTP is failing by saying "File doesn't exist" even the file exists and a valid file. > ------------------------------------------------------------------------------------ > > Key: VFS-201 > URL: https://issues.apache.org/jira/browse/VFS-201 > Project: Commons VFS > Issue Type: Bug > Environment: Linux > Reporter: Satish Kumar Kommuri > > Hi, > We are facing a strange problem with vfs file transfer from one of the FTP locations. Java code throws the FileSystemException by saying " does not exist". On the other hand, FTP to that site and wget are working. > Please find the code snippent below: > FileSystemOptions fso = new FileSystemOptions(); > SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fso, "no"); > FileObject sourceFileObject = fsm.resolveFile(sourceUri, fso); > String sourceFilePath = sourceFileObject.getName().getPath(); > FileObject targetFileObject = fsm.resolveFile(targetUri, fso); > FileObject tfo = targetFileObject; > if(tfo.getType() == FileType.FOLDER) > tfo = targetFileObject.resolveFile(sourceFileObject.getName().getBaseName()); > LOGGER.info("The URI is a file"); > LOGGER.info("Remote Path: [" + sourceFileObject.getName().getPath() + "] Local Path: [" + tfo.getName().getPath() + "]"); > copyFile(sourceFileObject, tfo); > copyFrom method: > private void copyFile(FileObject sourceFileObject, FileObject targetFileObject) > { > targetFileObject.copyFrom(sourceFileObject, new AllFileSelector()); > copiedFiles.add(sourceFileObject.getName().getPath()); > } catch (FileSystemException e) > { > failedFiles.add(sourceFileObject.getName().getPath()); > failedFileExceptions.add(e); > LOGGER.error("Exception in FileTransferAgent:copyFile "+e); > } > } > exception is: > Exception in FileTransferAgent:copyFile org.apache.commons.vfs.FileSystemException: Could not copy "ftp://usename:password@ipaddress/home/blrproj/console.out" because it does not exist. > org.apache.commons.vfs.FileSystemException: Could not copy "ftp://usename:password@ipaddress/home/blrproj/console.out" because it does not exist. > at org.apache.commons.vfs.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:858) > at FileTransferAgent.copyFile(FileTransferAgent.java:153) > at FileTransferAgent.copyFiles(FileTransferAgent.java:131) > at FileTransferAgent.main(FileTransferAgent.java:238) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.