• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do content search in remote server

 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI i want my application to do string search in files on the remote server and if it matches download that file.Can anybody suggest
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've given us a fraction of the requirements for your task. What are you allowed to do on the remote server? What protocol(s) can you use to communicate? What is your user doing on the local system?
Have a look at our FAQ, How To Ask Questions On JavaRanch. The better questions you ask, the more help we can be.
 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe! Thanks for reminding me. Actually I want to create java search engine in a web application which can search a String inside file present in the same as well as remote web server.What i want to know is -how we can search in a remote server.I am not getting any idea.Is there any way if we know remote server's address,user name,port,password etc we can parse all the files on that server and check if string is matching in any file.Because my application is running in my webserver how can it search in remote web server?I think downloading each file to local and then searching in it is dumb way.It will consume lots of resoures and time.

I am using apache web server,my application is web-based.And i want to search in files like .doc,txt

I have checked out apaches ant tool to do remote task using rexec but it needs a daemon to be run on the target server.Also apache's lucene open source search engine is there which i am not sure can search content of remote file!


Thanks In advance to anyone who tries to figure out the solution.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by raj aaryn:
Is there any way if we know remote server's address,user name,port,password etc we can parse all the files on that server and check if string is matching in any file.

It depends on the remote server. Can you telnet to it? At the most basic, you could script a telnet session to grep through the remote files. This would be slow and tedious, but it may get the job done.

Originally posted by raj aaryn:

Because my application is running in my webserver how can it search in remote web server?

Your code running in a web server doesn't get you any special access. If there's an application server on the remote server, you could write a web app to do the search for you. Of course, you'd want to make sure you secure it well. It's a Bad Idea to open up a server's contents to anyone who happens by.

Originally posted by raj aaryn:

I think downloading each file to local and then searching in it is dumb way.It will consume lots of resoures and time.


Maybe. Then again, it may be a Good Idea to build an index of the remote server and search that locally. Then if you find a match, download the file.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting the impression that the remote server is a web server, and that you don't have any special access to it - is that correct?

If so, I'd look into a web spider like Nutch. It can generate an index for a remote web server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!