getMediaType() публичный Метод

This resource's mediaType.
public getMediaType ( ) : MediaType
Результат MediaType
Пример #1
0
 /// 
 /// <param name="resource"></param>
 private void fixResourceHref(Resource resource)
 {
     if (StringUtil.isNotBlank(resource.getHref())
            && !resources.ContainsKey(resource.getHref()))
     {
         return;
     }
     if (StringUtil.isBlank(resource.getHref()))
     {
         if (resource.getMediaType() == null)
         {
             throw new ArgumentException("Resource must have either a MediaType or a href");
         }
         int i = 1;
         String href = createHref(resource.getMediaType(), i);
         while (resources.ContainsKey(href))
         {
             href = createHref(resource.getMediaType(), (++i));
         }
         resource.setHref(href);
     }
 }
Пример #2
0
 /// 
 /// <param name="resource"></param>
 private string getResourceItemPrefix(Resource resource)
 {
     String result;
     if (MediatypeService.isBitmapImage(resource.getMediaType()))
     {
         result = IMAGE_PREFIX;
     }
     else
     {
         result = ITEM_PREFIX;
     }
     return result;
 }
Пример #3
0
 /// 
 /// <param name="resource"></param>
 private string getResourceItemPrefix(Resource resource)
 {
     String result;
     if (MediatypeService.isBitmapImage(resource.getMediaType()))
     {
         result = IMAGE_PREFIX;
     }
     else
     {
         result = ITEM_PREFIX;
     }
     return result;
 }
Пример #4
0
 /// 
 /// <param name="resource"></param>
 private void fixResourceHref(Resource resource)
 {
     if (StringUtil.isNotBlank(resource.getHref())
            && !resources.ContainsKey(resource.getHref()))
     {
         return;
     }
     if (StringUtil.isBlank(resource.getHref()))
     {
         if (resource.getMediaType() == null)
         {
             throw new ArgumentException("Resource must have either a MediaType or a href");
         }
         int i = 1;
         String href = createHref(resource.getMediaType(), i);
         while (resources.ContainsKey(href))
         {
             href = createHref(resource.getMediaType(), (++i));
         }
         resource.setHref(href);
     }
 }