lpr-b-2007-2008: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-2007-2008/codiceprotocoltesterurl.txt · Ultima modifica: 19/09/2008 alle 14:08 (17 anni fa) da 127.0.0.1