URI Dan URL
URI Dan URL
URI Dan URL
A URL unambiguously identifies the location of a resource on the Internet. A URL is the most common
type of URI, or Uniform Resource Identifier. A URI can identify a resource by its network location, as in a
URL, or by its name, number, or other characteristics. The URL class is the simplest way for a Java
program to locate and retrieve data from the network.
URI
A Uniform Resource Identifier (URI) is a string of characters in a particular syntax that identifies a
resource. The resource identified may be a file on a server; but it may also be an email address, a news
message, a book, a person’s name, an Internet host, the current stock price of Oracle, or something else.
The syntax of a URI is composed of a scheme and a scheme-specific part, separaa colon, like this:
scheme:scheme-specific-part
The syntax of the scheme-specific part depends on the scheme being used. Current schemes include:
URL
A URL is a URI that, as well as identifying a resource, provides a specific network location for the
resource that a client can use to retrieve a representation of that resource. By contrast, a generic URI
may tell you what a resource is, but not actually tell you where or how to get that resource.
protocol://userInfo@host:port/path?query#fragment
Tugas Mandiri :
Baca Chapter URI dan URL pada halaman yang tertera di atas, lalu buatlah program untuk :
1. Mengekstrak bagian-bagian dari sebuah URI and URL pada string link yang diinputkan sesuai
dengan sintaks skema dari URI itu sendiri
2. Melakukan grabbing data pada sebuah website; pada program ini user akan menginputkan link
http://www.bmkg.go.id/BMKG_Pusat/Kualitas_Udara/Informasi_Partikulat.bmkg
- Ketika user menginputkan link, maka program akan membaca url dan mengambil data
halaman website, lalu masukkan halaman website tersebut ke dalam sebuah file txt.
- Lalu baca source tersebut dan ambil data table tingkat partikulat di dan masukkan ke dalam
sebuah file json.