aspose file tools*
The moose likes Other Open Source Projects and the fly likes Search for files over sFTP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Search for files over sFTP" Watch "Search for files over sFTP" New topic
Author

Search for files over sFTP

Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Hi,

I am trying to import files, whose names match a particular pattern,over sFTP. I am using JSch for this. Any ideas to how to actually search through the files to get the initial list?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

We ran across the same issue. Unfortunately you'll have to bring them back as a list of names (URIs) and perform a pattern match search in Java.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
Hmm. On another note, my client is Windows and the server is UNIX.I plan to use RSA public/private key authentication.

How do I generate the key on windows? Can i generate the key on the UNIX server and use it on the windows client instead?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Any keygen software ought to work, many people use UNIX command line or a tool called 'puttY'
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

I am trying to import files, whose names match a particular pattern,over sFTP. I am using JSch for this. Any ideas to how to actually search through the files to get the initial list?


With JSCh you can use a glob pattern to filter files. http://epaul.github.com/jsch-documentation/simple.javadoc/
Assuming, that the files - test.txt, text.jpg, test.pdf, image.gif
are present at the remote server location
location - /user/home/testDirectory

You can use this to filter files with prefix 'test'.


Thanks,
Tushar (SCJP 1.5)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Search for files over sFTP