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 com.google.common.base.Optional;
import com.google.common.collect.Maps;

public final class URISchemeDefaults {
    private final Map map = Maps.newHashMap();

    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