Tabnine Logo
Item.getFirstResource
Code IndexAdd Tabnine to your IDE (free)

How to use
getFirstResource
method
in
org.fourthline.cling.support.model.item.Item

Best Java code snippets using org.fourthline.cling.support.model.item.Item.getFirstResource (Showing top 7 results out of 315)

origin: hezhubo/HPlayer

public ContentItem(Service service, Item item) {
  this.service = service;
  didlObject = item;
  id = item.getId();
  title = item.getTitle();
  isContainer = false;
  try {
    format = item.getFirstResource().getProtocolInfo().getContentFormat();
  } catch (Exception e) {
    e.printStackTrace();
  }
  try {
    url = item.getFirstResource().getValue();
  } catch (Exception e) {
    e.printStackTrace();
  }
}
origin: hubing8658/UPnP-DLNA-Demo

private void init() {
  MyApplication app = (MyApplication) getApplication();
  Item item = app.getItem();
  app.setItem(null);
  imageurl = item.getFirstResource().getValue();
  name = item.getTitle();
}
origin: hezhubo/HPlayer

@Override
public Response serve(IHTTPSession session) {
  String itemId = session.getUri().replaceFirst("/", "");
  itemId = URLDecoder.decode(itemId);
  if (itemId != null && ContentTree.hasNode(itemId)) {
    ContentNode node = ContentTree.getNode(itemId);
    if (node.isItem()) {
      String localPath = node.getFullPath();
      Long fileSize = node.getItem().getFirstResource().getSize();
      String mimeType = node.getItem().getFirstResource()
          .getProtocolInfo().getContentFormatMimeType().toString();
      return responseFile(mimeType, localPath, fileSize);
    }
  }
  Log.d(TAG, " response error!");
  String msg = "<html><body><h1>Error</h1>\n" + "</body></html>\n";
  return newFixedLengthResponse(msg);
}
origin: hubing8658/UPnP-DLNA-Demo

String uri = item.getFirstResource().getValue();
DIDLContent didlContent = new DIDLContent();
didlContent.addItem(item);
origin: fire3/sailorcast

upnpItem.getCreator(), "", "", upnpItem.getFirstResource().getValue(),
"object.item." + type);
origin: trishika/DroidUPnP

upnpItem.getCreator(), "", "", upnpItem.getFirstResource().getValue(),
"object.item." + type);
origin: hubing8658/UPnP-DLNA-Demo

@Override
public void received(ActionInvocation actionInvocation,
    DIDLContent didl) {
  LogUtil.d(TAG,
      "Received browse action DIDL descriptor, creating tree nodes");
  try {
    handler.sendEmptyMessage(HandlerWhat.CLEAR_ALL);
    for (Container container : didl.getContainers()) {
      ContentItem ct = new ContentItem(container, service);
      sendMsg(ct);
    }
    for (Item item : didl.getItems()) {
      String contentFormat = item.getFirstResource().getProtocolInfo().getContentFormat();
      ContentItem ct = new ContentItem(item, service, FiletypeUtil
          .getFiletype(contentFormat));
      sendMsg(ct);
    }
  } catch (Exception e) {
    LogUtil.e(TAG, "Creating DIDL tree nodes failed: " + e);
    actionInvocation.setFailure(new ActionException(
        ErrorCode.ACTION_FAILED,
        "Can't create list childs: " + e, e));
    failure(actionInvocation, null);
  }
}
org.fourthline.cling.support.model.itemItemgetFirstResource

Popular methods of Item

  • getId
  • getTitle
  • getCreator
  • getRefID
  • getResources
  • getClazz
  • getParentID
  • getWriteStatus
  • setRefID
  • <init>
  • addDescMetadata
  • addResource
  • addDescMetadata,
  • addResource,
  • getDescMetadata,
  • isRestricted,
  • setId,
  • setParentID,
  • setRestricted,
  • getFirstProperty,
  • getProperties

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now