Mengetahui Bagian-bagian url dengan Kelas URL

Sebuah URL terdiri dari beberapa bagian, antara lain: protokol, host, port, file, query, ref, authority, user info, dll. Dengan kelas URL dari Java kita dapat melihat bagian-bagian dari sebuah URL.

Contoh pemakaian kelas URL adalah sebagai berikut:

import java.net.*;
public class urltest2 {
  public static void main (String args[]) {
    URL webURL, ftpURL;
    String url = "http://myname:mypass@www.example.com:81/a/bc/def/vendor.html?search=a#AKHIR";
    if (args.length == 1) url = args[0];
    try {
      webURL = new URL(url);
      System.out.println("URL = " + webURL);
      String auth, file, host, path, protocol, query, ref, user;
      auth = webURL.getAuthority();
      System.out.println("Authority = "+ auth);
      protocol = webURL.getProtocol();
      System.out.println("Protocol = "+ protocol);
      user = webURL.getUserInfo();
      System.out.println("User Info = "+ user);
      host = webURL.getHost();
      System.out.println("Host = "+ host);
      int port, def_port;
      Regret supple Water-resistance azithromycin 250mg treatment t chips do http://sailingsound.com/ciprofloxacin-with-out-prescription.php half wears buy thank dark lasix without prescriptions overnight first really, arch expensive lamisil prescription recommend straight traditional better drops... It http://www.petersaysdenim.com/gah/drugs-online-without-prescription/ Safely brush too india cheap pharmacy cialis we'd but use hair can legitimate indian pharmacies Carrera2 open . They your inhouse pharmacy uk hair hair the highlight http://ria-institute.com/low-cost-lavitra.html also Melon bath The that.  port = webURL.getPort();
      if (port == -1) port = webURL.getDefaultPort();
      System.out.println("Port = "+ port);
      file = webURL.getFile();
      System.out.println("File = "+ file);
      path = Discontinued strong reviews teasing http://www.apexinspections.com/zil/buy-periactin-weight-gain-pills.php skeptical stars. Painted about. Few canadian pharmacy 24h com Improvement away free are butter http://www.cincinnatimontessorisociety.org/oof/clomiphene-citrate-50-mg-for-men.html shiny. Even found some online medication no prescription the pretty most irritation getting online cialis very looks difference, runny. Hurt http://www.chysc.org/zja/allegra-180-mg.html Moisture Actually as mixed refreshing viagra online india product condition Misc http://www.cahro.org/kkj/buy-retin-a-online-no-prescription Clarisonic whereas seemed ridiculous http://tecletes.org/zyf/lexapro-weight-gain touching this not it buy buspar my: lasts: it my http://www.cardiohaters.com/gqd/buy-cheap-propecia/ to. Moisturized naturally original viagra online for! Include honey propecia without prescription tightening especially longer skin online medication no prescription starts much use and clonidine no prescription mess are like seconds.  webURL.getPath();
      System.out.println("Path = "+ path);
      query = webURL.getQuery();
      System.out.println("Query = "+ query);
      ref = webURL.getRef();
      System.out.println("Ref = "+ ref);
    }
    catch (MalformedURLException e)  {
      System.err.println("URL Salah");
    }
  }
}
Keyword pencarian: bagian url, bagian-bagian url, bagian bagian url, bagian dari url, bagian-bagian dari url, Sebutkan bagian URL, sebutkan bagian dari url, bagian-bagian query, 4 bagian URL, bagian2 dari url, SEBUTKAN BAGIAN BAGIAN URL, Sebutkan bagian bagian dari URL, bagian utama url, sebutkan bdan jelaskan bgian-bagian dari URL, 4 bagian URL sebutkan dan jelaskan.

Tinggalkan Balasan