Parse Host : URL « Network « Java Tutorial

Java Tutorial
1. Language
2. Data Type
3. Operators
4. Statement Control
5. Class Definition
6. Development
7. Reflection
8. Regular Expressions
9. Collections
10. Thread
11. File
12. Generics
13. I18N
14. Swing
15. Swing Event
16. 2D Graphics
17. SWT
18. SWT 2D Graphics
19. Network
20. Database
21. Hibernate
22. JPA
23. JSP
24. JSTL
25. Servlet
26. Web Services SOA
27. EJB3
28. Spring
29. PDF
30. Email
31. J2ME
32. J2EE Application
33. XML
34. Design Pattern
35. Log
36. Security
37. Apache Common
38. Ant
39. JUnit
Java
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Tutorial » Network » URL 
19. 2. 10. Parse Host
public class Utils {
  /**
   @param hostStr
   @return
   */
  static public String parseHost(String hostStr) {
      int sepIdx = hostStr.indexOf(':');
      if (sepIdx < 0) {
          return hostStr;
      else {
          return hostStr.substring(0, sepIdx);
      }
  }
}
19. 2. URL
19. 2. 1. Creating a URL With components
19. 2. 2. Creating a URL with a single string.
19. 2. 3. Create a URL that refers to a jar file in the file system
19. 2. 4. Create a URL that refers to an entry in the jar file
19. 2. 5. java.net.URL
19. 2. 6. A class that displays information about a URL
19. 2. 7. ProtocolTester
19. 2. 8. Parsing a URL
19. 2. 9. Eliminate Query
19. 2. 10. Parse Host
19. 2. 11. Parse Port
19. 2. 12. Make a URL from the given string
19. 2. 13. Create BufferedInputStream from URL
19. 2. 14. Utility to convert File to URL.
19. 2. 15. Read from URL
19. 2. 16. Get Content from a URL
19. 2. 17. Save binary file from URL
19. 2. 18. Reading A Web Resource: Opening a URL's stream
19. 2. 19. Relative URL
19. 2. 20. Resolve a relative URL
19. 2. 21. Build query string for URL
19. 2. 22. URL Equality
19. 2. 23. URL Splitter
19. 2. 24. new URL('mailto:your@yourserver.net')
19. 2. 25. Getting Text from a URL
19. 2. 26. Getting an Image from a URL
19. 2. 27. Getting a Jar File Using a URL
19. 2. 28. File size from URL
19. 2. 29. Returns true if the URL represents a path, and false otherwise.
19. 2. 30. Locating files by path or URL
19. 2. 31. provides a simple interface for assembling GET URLs
19. 2. 32. Add Parameter to URL
19. 2. 33. Extracts the base URL from the given URL by stripping the query and anchor part.
19. 2. 34. Returns the anchor value of the given URL
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.