protected boolean isUsableImageType(MimeType mt) { return mt.getType().equals("image") && (mt.getSubtype().equals("png") || mt.getSubtype().equals("jpg") || mt.getSubtype().equals("jpeg") || mt.getSubtype().equals("gif")); }
public ProtocolInfo(MimeType contentFormatMimeType) { this.protocol = Protocol.HTTP_GET; this.contentFormat = contentFormatMimeType.toString(); }
public MimeType getContentFormatMimeType() throws IllegalArgumentException { return MimeType.valueOf(contentFormat); }
public static MimeType getMimeType(String extension) { String ret = mimeTypes.get(extension.toLowerCase(Locale.ROOT)); if (ret == null) { ret = "application/octet-stream"; } String sp[] = ret.split("/"); return new MimeType(sp[0], sp[1]); } }
public boolean isUDACompliantXML() { // UDA spec says "must be text/xml", however, sometimes you get a charset token as well... return isText() && getValue().getSubtype().equals(DEFAULT_CONTENT_TYPE.getSubtype()); }
start = readParamsIntoMap(map, params, start); return new MimeType(major, subtype, map); } else { return new MimeType(major, subtype);
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(toStringNoParameters()); if (getParameters() != null || getParameters().size() > 0) { for (String name : getParameters().keySet()) { sb.append(";").append(name).append("=\"").append(getParameters().get(name)).append("\""); } } return sb.toString(); }
public String getContentTypeCharset() { ContentTypeHeader ct = getContentTypeHeader(); return ct != null ? ct.getValue().getParameters().get("charset") : null; }
.getColumnIndex(MediaStore.Images.Media.SIZE)); Res res = new Res(new MimeType(mimeType.substring(0, mimeType.indexOf('/')), mimeType.substring(mimeType.indexOf('/') + 1)), size, resAddress + id); ImageItem imageItem = new ImageItem(id, ContentTree.IMAGE_ID,
public boolean isUDACompliantXML() { // UDA spec says "must be text/xml", however, sometimes you get a charset token as well... return isText() && getValue().getSubtype().equals(DEFAULT_CONTENT_TYPE.getSubtype()); }
public String getContentTypeCharset() { ContentTypeHeader ct = getContentTypeHeader(); return ct != null ? ct.getValue().getParameters().get("charset") : null; }
/** * Used internally by Cling when {@link RemoteDevice} is discovered, you shouldn't have to call this. */ public Icon(String mimeType, int width, int height, int depth, URI uri) { this(mimeType != null && mimeType.length() > 0 ? MimeType.valueOf(mimeType) : null, width, height, depth, uri, null); }
String resolution = cur.getString(cur.getColumnIndex(Video.Media.RESOLUTION)); Res res = new Res(new MimeType(mimeType.substring(0, mimeType.indexOf('/')), mimeType.substring(mimeType.indexOf('/') + 1)), size, resAddress + id); res.setDuration(DurationUtil.toMilliTimeString(duration));
public String getString() { return getValue().toString(); }
public String toStringNoParameters() { return getType() + "/" + getSubtype(); }
public boolean isWildcardSubtype() { return this.getSubtype().equals(WILDCARD); }
public boolean isWildcardType() { return this.getType().equals(WILDCARD); }
public String getContentTypeCharset() { ContentTypeHeader ct = getContentTypeHeader(); return ct != null ? ct.getValue().getParameters().get("charset") : null; }