• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Retrieve partial domain name

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends..
i want to exactly retrieve the domain name like "austin" in http://www2.austin.cc.tx.us

yahoo from www.mail.yahoo.com // It is in 2nd position
austin from www2.austin.cc.tx.us // It is in 1st position
abc from www.xyz.qwerty.abc.efg.co.in // It is in 3rd position

is there any methods available in java?

actually now i am using this code



but it will work to retrieve domain only for 3digit country specific domain(.com,.edu,.org) and 2 + 2 country specific domain(co.in,co.us,co.uk). please help it is the important part in my project.it is not working in this case "www2.austin.cc.tx.us" because it has cc.tx.us as top level domain. please tell me how to solve this.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"one question", please check your private messages for an important administrative matter.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What makes "austin" special in "www2.austin.cc.tx.us"? It's just one part of a multipart domain name. Why would "abc" be special in "www.xyz.qwerty.abc.efg.co.in"?

If you could tell us the precise definition of what you consider to be a "domain", you could probably code it (or we could help you).
 
R Karthick
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..
We are providing free access to certain web pages to our customers because some sponsers will pay for that. For the convenience of the sponsers,we have to produce per url accounting to them.
for example:

URL Total.no.of.bytes accessed
http://yahoo.com 23456
http://www.google.com 36786

one sponser will pay for yahoo.com and another will pay for google.com

so i'm getting the data from cache(access.log) and i am comparing it with free_webpage_list file. now i have to compare URLs like com[/b]]http://www.yahoo.com from access.log file of cache and co.in]http://www.mail.yahoo.co.in from free_webpage_list file,so i'm trying to compare "yahoo" in both the URLs. After comparing i have to calculate the bytes used for those webpages.




to retrieve yahoo from both the files i'm using this code. but it works only for 3digit country specific domain(.com,.edu,.net and so on) and 2+2 country specific domains(co.in,co.uk,co.us). Not for TLDs like cc.tx.us
any help will be greatly appreciated..

Thanks..
[ February 12, 2008: Message edited by: onequestion ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"onequestion"-

You haven't changed your display name like you were asked to. This is not optional - accounts without a valid display name are generally closed. Please do this before your next post.

As to your question, it sounds like you'd be better off having a one-to-many mapping between a root name (like Yahoo) and actual URLs (like *.yahoo.*). There could be many different URL schemes that are tricky to capture in code in a general way.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic