Java 类org.springframework.boot.context.embedded.MimeMappings.Mapping 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Create a new {@link MimeMappings} from the specified mappings.
 * @param mappings the source mappings with extension as the key and mime-type as the
 * value
 */
public MimeMappings(Map<String, String> mappings) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
    for (Map.Entry<String, String> entry : mappings.entrySet()) {
        add(entry.getKey(), entry.getValue());
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Internal constructor.
 * @param mappings source mappings
 * @param mutable if the new object should be mutable.
 */
private MimeMappings(MimeMappings mappings, boolean mutable) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = (mutable
            ? new LinkedHashMap<String, MimeMappings.Mapping>(mappings.map)
            : Collections.unmodifiableMap(mappings.map));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    if (obj instanceof Mapping) {
        Mapping other = (Mapping) obj;
        return this.extension.equals(other.extension)
                && this.mimeType.equals(other.mimeType);
    }
    return false;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:UndertowEmbeddedServletContainerFactoryTests.java   
@Override
protected Collection<Mapping> getExpectedMimeMappings() {
    // Unlike Tomcat and Jetty, Undertow performs a case-sensitive match on file
    // extension so it has a mapping for "z" and "Z".
    Set<Mapping> expectedMappings = new HashSet<Mapping>(
            super.getExpectedMimeMappings());
    expectedMappings.add(new Mapping("Z", "application/x-compress"));
    return expectedMappings;
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Create a new {@link MimeMappings} from the specified mappings.
 * @param mappings the source mappings with extension as the key and mime-type as the
 * value
 */
public MimeMappings(Map<String, String> mappings) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
    for (Map.Entry<String, String> entry : mappings.entrySet()) {
        add(entry.getKey(), entry.getValue());
    }
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Internal constructor.
 * @param mappings source mappings
 * @param mutable if the new object should be mutable.
 */
private MimeMappings(MimeMappings mappings, boolean mutable) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = (mutable
            ? new LinkedHashMap<String, MimeMappings.Mapping>(mappings.map)
            : Collections.unmodifiableMap(mappings.map));
}
项目:spring-boot-concourse    文件:MimeMappings.java   
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    if (obj instanceof Mapping) {
        Mapping other = (Mapping) obj;
        return this.extension.equals(other.extension)
                && this.mimeType.equals(other.mimeType);
    }
    return false;
}
项目:spring-boot-concourse    文件:UndertowEmbeddedServletContainerFactoryTests.java   
@Override
protected Collection<Mapping> getExpectedMimeMappings() {
    // Unlike Tomcat and Jetty, Undertow performs a case-sensitive match on file
    // extension so it has a mapping for "z" and "Z".
    Set<Mapping> expectedMappings = new HashSet<Mapping>(
            super.getExpectedMimeMappings());
    expectedMappings.add(new Mapping("Z", "application/x-compress"));
    return expectedMappings;
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Create a new {@link MimeMappings} from the specified mappings.
 * @param mappings the source mappings with extension as the key and mime-type as the
 * value
 */
public MimeMappings(Map<String, String> mappings) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
    for (Map.Entry<String, String> entry : mappings.entrySet()) {
        add(entry.getKey(), entry.getValue());
    }
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Internal constructor.
 * @param mappings source mappings
 * @param mutable if the new object should be mutable.
 */
private MimeMappings(MimeMappings mappings, boolean mutable) {
    Assert.notNull(mappings, "Mappings must not be null");
    this.map = (mutable
            ? new LinkedHashMap<String, MimeMappings.Mapping>(mappings.map)
            : Collections.unmodifiableMap(mappings.map));
}
项目:contestparser    文件:MimeMappings.java   
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (obj == this) {
        return true;
    }
    if (obj instanceof Mapping) {
        Mapping other = (Mapping) obj;
        return this.extension.equals(other.extension)
                && this.mimeType.equals(other.mimeType);
    }
    return false;
}
项目:contestparser    文件:UndertowEmbeddedServletContainerFactoryTests.java   
@Override
protected Collection<Mapping> getExpectedMimeMappings() {
    // Unlike Tomcat and Jetty, Undertow performs a case-sensitive match on file
    // extension so it has a mapping for "z" and "Z".
    Set<Mapping> expectedMappings = new HashSet<Mapping>(
            super.getExpectedMimeMappings());
    expectedMappings.add(new Mapping("Z", "application/x-compress"));
    return expectedMappings;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Create a new empty {@link MimeMappings} instance.
 */
public MimeMappings() {
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
@Override
public Iterator<Mapping> iterator() {
    return getAll().iterator();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
public Mapping(String extension, String mimeType) {
    Assert.notNull(extension, "Extension must not be null");
    Assert.notNull(mimeType, "MimeType must not be null");
    this.extension = extension;
    this.mimeType = mimeType;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:UndertowEmbeddedServletContainerFactory.java   
private void configureMimeMappings(DeploymentInfo servletBuilder) {
    for (Mapping mimeMapping : getMimeMappings()) {
        servletBuilder.addMimeMapping(new MimeMapping(mimeMapping.getExtension(),
                mimeMapping.getMimeType()));
    }
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Create a new empty {@link MimeMappings} instance.
 */
public MimeMappings() {
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
}
项目:spring-boot-concourse    文件:MimeMappings.java   
@Override
public Iterator<Mapping> iterator() {
    return getAll().iterator();
}
项目:spring-boot-concourse    文件:MimeMappings.java   
public Mapping(String extension, String mimeType) {
    Assert.notNull(extension, "Extension must not be null");
    Assert.notNull(mimeType, "MimeType must not be null");
    this.extension = extension;
    this.mimeType = mimeType;
}
项目:spring-boot-concourse    文件:UndertowEmbeddedServletContainerFactory.java   
private void configureMimeMappings(DeploymentInfo servletBuilder) {
    for (Mapping mimeMapping : getMimeMappings()) {
        servletBuilder.addMimeMapping(new MimeMapping(mimeMapping.getExtension(),
                mimeMapping.getMimeType()));
    }
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Create a new empty {@link MimeMappings} instance.
 */
public MimeMappings() {
    this.map = new LinkedHashMap<String, MimeMappings.Mapping>();
}
项目:contestparser    文件:MimeMappings.java   
@Override
public Iterator<Mapping> iterator() {
    return getAll().iterator();
}
项目:contestparser    文件:MimeMappings.java   
public Mapping(String extension, String mimeType) {
    Assert.notNull(extension, "Extension must not be null");
    Assert.notNull(mimeType, "MimeType must not be null");
    this.extension = extension;
    this.mimeType = mimeType;
}
项目:contestparser    文件:UndertowEmbeddedServletContainerFactory.java   
private void configureMimeMappings(DeploymentInfo servletBuilder) {
    for (Mapping mimeMapping : getMimeMappings()) {
        servletBuilder.addMimeMapping(new MimeMapping(mimeMapping.getExtension(),
                mimeMapping.getMimeType()));
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Returns all defined mappings.
 * @return the mappings.
 */
public Collection<Mapping> getAll() {
    return this.map.values();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Add a new mime mapping.
 * @param extension the file extension (excluding '.')
 * @param mimeType the mime type to map
 * @return any previous mapping or {@code null}
 */
public String add(String extension, String mimeType) {
    Mapping previous = this.map.put(extension, new Mapping(extension, mimeType));
    return (previous == null ? null : previous.getMimeType());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Get a mime mapping for the given extension.
 * @param extension the file extension (excluding '.')
 * @return a mime mapping or {@code null}
 */
public String get(String extension) {
    Mapping mapping = this.map.get(extension);
    return (mapping == null ? null : mapping.getMimeType());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MimeMappings.java   
/**
 * Remove an existing mapping.
 * @param extension the file extension (excluding '.')
 * @return the removed mime mapping or {@code null} if no item was removed
 */
public String remove(String extension) {
    Mapping previous = this.map.remove(extension);
    return (previous == null ? null : previous.getMimeType());
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Returns all defined mappings.
 * @return the mappings.
 */
public Collection<Mapping> getAll() {
    return this.map.values();
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Add a new mime mapping.
 * @param extension the file extension (excluding '.')
 * @param mimeType the mime type to map
 * @return any previous mapping or {@code null}
 */
public String add(String extension, String mimeType) {
    Mapping previous = this.map.put(extension, new Mapping(extension, mimeType));
    return (previous == null ? null : previous.getMimeType());
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Get a mime mapping for the given extension.
 * @param extension the file extension (excluding '.')
 * @return a mime mapping or {@code null}
 */
public String get(String extension) {
    Mapping mapping = this.map.get(extension);
    return (mapping == null ? null : mapping.getMimeType());
}
项目:spring-boot-concourse    文件:MimeMappings.java   
/**
 * Remove an existing mapping.
 * @param extension the file extension (excluding '.')
 * @return the removed mime mapping or {@code null} if no item was removed
 */
public String remove(String extension) {
    Mapping previous = this.map.remove(extension);
    return (previous == null ? null : previous.getMimeType());
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Returns all defined mappings.
 * @return the mappings.
 */
public Collection<Mapping> getAll() {
    return this.map.values();
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Add a new mime mapping.
 * @param extension the file extension (excluding '.')
 * @param mimeType the mime type to map
 * @return any previous mapping or {@code null}
 */
public String add(String extension, String mimeType) {
    Mapping previous = this.map.put(extension, new Mapping(extension, mimeType));
    return (previous == null ? null : previous.getMimeType());
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Get a mime mapping for the given extension.
 * @param extension the file extension (excluding '.')
 * @return a mime mapping or {@code null}
 */
public String get(String extension) {
    Mapping mapping = this.map.get(extension);
    return (mapping == null ? null : mapping.getMimeType());
}
项目:contestparser    文件:MimeMappings.java   
/**
 * Remove an existing mapping.
 * @param extension the file extension (excluding '.')
 * @return the removed mime mapping or {@code null} if no item was removed
 */
public String remove(String extension) {
    Mapping previous = this.map.remove(extension);
    return (previous == null ? null : previous.getMimeType());
}