I meet a trouble.
FileSystemManager fsManager = VFS.getManager();
FileObject sftpFile = fsManager.resolveFile(
"sftp://root:[EMAIL PROTECTED]:22/root/vfs1" );
I cann't connect to the SFTP server. But I can success when I user example
"TestSftp.java" with the same parameters
Can u give me what's wrong with me? THX
-----原始邮件-----
发件人: Robert Enyedi [mailto:[EMAIL PROTECTED]
发送时间: 2005年12月29日 18:26
收件人: Jakarta Commons Users List
主题: Re: 答复: vfs question
I think that you should use the following API for retrieving the file:
FileSystemManager fsManager = VFS.getManager();
FileObject sshFile = fsManager.resolveFile(
"ssh://[EMAIL PROTECTED]:22/root/vfs" );
See http://jakarta.apache.org/commons/vfs/api.html for more information.
Regards,
Robert
On 12/29/05, 丁睿 <[EMAIL PROTECTED]> wrote:
>
>
> another question:
>
>
> I use sftp Iike this:
>
>
> SEG1:
> SftpFileProvider sftpProverder=new SftpFileProvider();
> sftpProverder.init();
> mgr = new DefaultFileSystemManager();
> mgr.addProvider("sftp",sftpProverder);
> mgr.setDefaultProvider(sftpProverder);
> mgr.init();
>
> FileObject
> cwd1=(SftpFileObject)mgr.resolveFile("[EMAIL PROTECTED]:22/root/vfs1");
>
> mgr.close();
>
>
>
>
> SEG2:
> I find in org.apache.commons.vfs.provider.sftp.SftpClientFactory
>
> public static Session createConnection(String hostname, int port,
> String username, String password, FileSystemOptions fileSystemOptions)
> throws FileSystemException
> {
> ...
> UserInfo userInfo = SftpFileSystemConfigBuilder.getInstance
> ().getUserInfo(fileSystemOptions);
> ..
> }
>
>
> If I don't call setBaseFile() in SEG1, the userInfo is null,then I
> cann't connect to SFTP server.
>
> But on http://jakarta.apache.org/commons/vfs/api.html
>
> Set the base file using setBaseFile(). The base file is used to resolve
> relative URI passed to resolveFile(). This step is optional.
>
>
>
> Am I don't catch the meaning? THX
>
>
> -----原始邮件-----
> 发件人: Robert Enyedi [mailto:[EMAIL PROTECTED]
> 发送时间: 2005年12月29日 17:38
> 收件人: Jakarta Commons Users List
> 主题: Re: vfs question
>
>
> Hi,
>
> Both org.apache.commons.httpclient.URIException and import
> org.apache.commons.httpclient.util.URIUtil are used by the URLFileName
> class. And yes, VFS has a dependency on the Commons HttpClient library.
> Was
> this your question?
>
> Regards,
> Robert
>
> On 12/29/05, ?? <[EMAIL PROTECTED]> wrote:
> >
> >
> > any body use vfs?
> >
> > I meet a question?
> >
> > in org.apache.commons.vfs.provider.URLFileName ;
> >
> > import org.apache.commons.httpclient.URIException;
> ???????why?
> > import org.apache.commons.httpclient.util.URIUtil
> > ; ???????why?
> > import org.apache.commons.vfs.FileName;
> > import org.apache.commons.vfs.FileSystemException;
> > import org.apache.commons.vfs.FileType;
> >
> >
> >
> >
> > if the class like this.it's depended on Commons Httpclient.
> >
> >
> > Is there any question here?
> >
> >
> >
> >
> ********************************************************************************************************************************
> > The information in this email is confidential and may be legally
> > privileged. If you have received this email in error or are
> > not the intended recipient, please immediately notify the sender and
> > delete this message from your computer. Any use, distribution,
> > or copying of this email other than by the intended recipient is
> strictly
> > prohibited. All messages sent to and from us may be
> > monitored to ensure compliance with internal policies and to protect our
> > business.
> > Emails are not secure and cannot be guaranteed to be error free as they
> > can be intercepted, amended, lost or destroyed,
> > or contain viruses. Anyone who communicates with us by email is taken to
> > accept these risks.
> >
> > 收发邮件者请注意:
> > 本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
> > 进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。
> >
> >
> ********************************************************************************************************************************
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> ********************************************************************************************************************************
> The information in this email is confidential and may be legally
> privileged. If you have received this email in error or are
> not the intended recipient, please immediately notify the sender and
> delete this message from your computer. Any use, distribution,
> or copying of this email other than by the intended recipient is strictly
> prohibited. All messages sent to and from us may be
> monitored to ensure compliance with internal policies and to protect our
> business.
> Emails are not secure and cannot be guaranteed to be error free as they
> can be intercepted, amended, lost or destroyed,
> or contain viruses. Anyone who communicates with us by email is taken to
> accept these risks.
>
> 收发邮件者请注意:
> 本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
> 进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。
>
> ********************************************************************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If
you have received this email in error or are
not the intended recipient, please immediately notify the sender and delete
this message from your computer. Any use, distribution,
or copying of this email other than by the intended recipient is strictly
prohibited. All messages sent to and from us may be
monitored to ensure compliance with internal policies and to protect our
business.
Emails are not secure and cannot be guaranteed to be error free as they can be
intercepted, amended, lost or destroyed,
or contain viruses. Anyone who communicates with us by email is taken to accept
these risks.
收发邮件者请注意:
本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。
********************************************************************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]