Strumenti Utente

Strumenti Sito


lpr-b:codiceprotocoltesterurl
package url;
 
import java.net.URL;
 
public class ProtocolTester {
 
  public static void main(String[] args) {
 
    String host = args[0];
    String file = "/index.html";
 
    String[] schemes = { "http", "https", "ftp", "mailto", "telnet", "file", "ldap", "gopher",
        "jdbc", "rmi", "jndi", "jar", "doc", "netdoc", "nfs", "verbatim", "finger", "daytime",
        "systemresource" };
 
    for (int i = 0; i < schemes.length; i++) {
      try {
        URL u = new URL(schemes[i], host, file);
        System.out.println("+ "+schemes[i]);
      } catch (Exception ex) {
        System.out.println("- "+schemes[i]);
      }
    }
 
  }
 
}
lpr-b/codiceprotocoltesterurl.txt · Ultima modifica: 26/10/2007 alle 08:10 (17 anni fa) da Marco Danelutto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki