/** * Returns a protocol by its scheme. If the latter is unknown, instantiate a * new protocol object. * * @param scheme * the scheme of the desired protocol. * @return a known protocol or a new instance. */ private Protocol getProtocol(String scheme) { Protocol protocol = Protocol.valueOf(scheme); if (protocol == null) { protocol = new Protocol(scheme); } return protocol; }
/** * Returns a protocol by its scheme. If the latter is unknown, instantiate a * new protocol object. * * @param scheme * the scheme of the desired protocol. * @return a known protocol or a new instance. */ private Protocol getProtocol(String scheme) { Protocol protocol = Protocol.valueOf(scheme); if (protocol == null) { protocol = new Protocol(scheme); } return protocol; }
result = ZIP; } else { result = new Protocol(name);
result = WAR; } else { result = new Protocol(name);
result = ZIP; } else { result = new Protocol(name);
/** * Creates the protocol associated to a URI scheme name. If an existing * constant exists then it is returned, otherwise a new instance is created. * * @param name * The scheme name. * @param version * The version number. * @return The associated protocol. */ public static Protocol valueOf(String name, String version) { Protocol result = valueOf(name); if (!version.equals(result.getVersion())) { result = new Protocol(result.getSchemeName(), result.getName(), result.getTechnicalName(), result.getDescription(), result.getDefaultPort(), result.isConfidential(), version); } return result; }
/** * Creates the protocol associated to a URI scheme name. If an existing * constant exists then it is returned, otherwise a new instance is created. * * @param name * The scheme name. * @param version * The version number. * @return The associated protocol. */ public static Protocol valueOf(String name, String version) { Protocol result = valueOf(name); if (!version.equals(result.getVersion())) { result = new Protocol(result.getSchemeName(), result.getName(), result.getTechnicalName(), result.getDescription(), result.getDefaultPort(), result.isConfidential(), version); } return result; }