Java examples for Network:Http
is content Type Binary
import java.util.HashSet; import java.util.Set; class AttachmentUtil { private static final Set<String> binaryPrefixes = new HashSet<String>(); static {/*from w w w . j av a2 s . co m*/ binaryPrefixes.add("image/"); binaryPrefixes.add("audio/"); binaryPrefixes.add("video/"); binaryPrefixes.add("application/x-shockwave-flash"); } public static final boolean isBinary(String contentType) { for (String prefix : binaryPrefixes) { if (contentType.startsWith(prefix)) { return true; } } return false; } }