All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.httpcache4j.uri.URISchemeDefaults Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package org.codehaus.httpcache4j.uri;

import java.util.Map;
import java.util.HashMap;
import net.hamnaberg.funclite.Optional;


public final class URISchemeDefaults {
    private final Map map = new HashMap();

    public URISchemeDefaults(Map defaults) {
        map.putAll(defaults);
    }

    public URISchemeDefaults() {
        map.put("http", 80);
        map.put("https", 443);
        map.put("ftp", 21);
        map.put("ssh", 22);
    }

    public Optional getPort(String scheme) {
        return Optional.fromNullable(map.get(scheme));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy