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

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

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

origin: 4thline/cling

if (item.getClazz() == null) {
  throw new RuntimeException("Missing 'upnp:class' element for item: " + item.getId());
if (item.getId() == null)
  throw new NullPointerException("Missing id on item: " + item);
itemElement.setAttribute("id", item.getId());
if (item.getParentID() == null)
  throw new NullPointerException("Missing parent id on item: " + item);
itemElement.setAttribute("parentID", item.getParentID());
if (item.getRefID() != null)
  itemElement.setAttribute("refID", item.getRefID());
itemElement.setAttribute("restricted", booleanToInt(item.isRestricted()));
String title = item.getTitle();
if (title == null) {
  log.warning("Missing 'dc:title' element for item: " + item.getId());
  title = UNKNOWN_TITLE;
  itemElement,
  "dc:creator",
  item.getCreator(),
  DIDLObject.Property.DC.NAMESPACE.URI
);
  itemElement,
  "upnp:writeStatus",
  item.getWriteStatus(),
origin: 4thline/cling

protected Item createItem(Attributes attributes) {
  Item item = new Item();
  item.setId(attributes.getValue("id"));
  item.setParentID(attributes.getValue("parentID"));
  try {
    Boolean value = (Boolean)Datatype.Builtin.BOOLEAN.getDatatype().valueOf(
        attributes.getValue("restricted")
    );
    if (value != null)
      item.setRestricted(value);
  } catch (Exception ex) {
    // Ignore
  }
  if ((attributes.getValue("refID") != null))
    item.setRefID(attributes.getValue("refID"));
  return item;
}
origin: 4thline/cling

public Item(Item other) {
  super(other);
  setRefID(other.getRefID());
}
origin: 4thline/cling

  @Override
  protected boolean isLastElement(String uri, String localName, String qName) {
    if (DIDLContent.NAMESPACE_URI.equals(uri) && "item".equals(localName)) {
      if (getInstance().getTitle() == null) {
        log.warning("In DIDL content, missing 'dc:title' element for item: " + getInstance().getId());
      }
      if (getInstance().getClazz() == null) {
        log.warning("In DIDL content, missing 'upnp:class' element for item: " + getInstance().getId());
      }
      return true;
    }
    return false;
  }
}
origin: 4thline/cling

form.addLabelAndSelectableLastField("Title:", item.getTitle(), this);
if (item.getCreator() != null) {
  form.addLabelAndSelectableLastField("DC Creator:", item.getCreator(), this);
if (item.getWriteStatus() != null) {
  form.addLabelAndSelectableLastField("UPnP Write Status:", item.getWriteStatus().toString(), this);
form.addLabelAndSelectableLastField("UPnP Class:", item.getClazz().getValue(), this);
form.addLabelAndSelectableLastField("ID:", item.getId(), this);
form.addLabelAndSelectableLastField("Parent ID:", item.getParentID(), this);
if (item.getRefID() != null) {
  form.addLabelAndSelectableLastField("Reference ID:", item.getRefID(), this);
if (item.hasProperty(DIDLObject.Property.DC.CONTRIBUTOR.class))
  form.addLabelAndSelectableLastField("DC Contributor:", item.getFirstProperty(DIDLObject.Property.DC.CONTRIBUTOR.class).toString(), this);
if (item.hasProperty(DIDLObject.Property.DC.DATE.class))
  form.addLabelAndSelectableLastField("DC Date:", item.getFirstProperty(DIDLObject.Property.DC.DATE.class).toString(), this);
if (item.hasProperty(DIDLObject.Property.DC.DESCRIPTION.class))
  form.addLabelAndSelectableLastField("DC Description:", item.getFirstProperty(DIDLObject.Property.DC.DESCRIPTION.class).toString(), this);
if (item.hasProperty(DIDLObject.Property.DC.LANGUAGE.class))
  form.addLabelAndSelectableLastField("DC Language:", item.getFirstProperty(DIDLObject.Property.DC.LANGUAGE.class).toString(), this);
if (item.hasProperty(DIDLObject.Property.DC.PUBLISHER.class))
  form.addLabelAndSelectableLastField("DC Publisher:", item.getFirstProperty(DIDLObject.Property.DC.PUBLISHER.class).toString(), this);
origin: fire3/sailorcast

final TrackMetadata trackMetadata = new TrackMetadata(upnpItem.getId(), upnpItem.getTitle(),
    upnpItem.getCreator(), "", "", upnpItem.getFirstResource().getValue(),
    "object.item." + type);
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: kingthy/TVRemoteIME

public static boolean isAudioItem(Item item) {
  // TODO zxt need check?
  String objectClass = item.getId();
  if (objectClass != null && objectClass.contains(DLNA_OBJECTCLASS_MUSICID)) {
    return true;
  }
  return false;
}
origin: 4thline/cling

public Component getTreeCellRendererComponent(
    JTree tree,
    Object value,
    boolean sel,
    boolean expanded,
    boolean leaf,
    int row,
    boolean hasFocus) {
  super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
  DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
  if (node.getUserObject() instanceof Container) {
    Container container = (Container) node.getUserObject();
    setText(container.getTitle());
    setIcon(expanded ? getContainerOpenIcon() : getContainerClosedIcon());
  } else if (node.getUserObject() instanceof Item) {
    Item item = (Item) node.getUserObject();
    setText(item.getTitle());
    DIDLObject.Class upnpClass = item.getClazz();
    setIcon(getItemIcon(item, upnpClass != null ? upnpClass.getValue() : null));
  } else if (node.getUserObject() instanceof String) {
    setIcon(getInfoIcon());
  }
  onCreate();
  return this;
}
origin: hezhubo/HPlayer

didl.addItem(contentNode.getItem());
Log.v(TAG, "returing item: " + contentNode.getItem().getTitle());
    didl.addItem(item);
    Log.v(TAG, "getting child item: " + item.getTitle());
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: trishika/DroidUPnP

private ArrayList<DIDLObjectDisplay> buildContentList(String parent, DIDLContent didl)
{
  ArrayList<DIDLObjectDisplay> list = new ArrayList<DIDLObjectDisplay>();
  if (parent != null)
    list.add(new DIDLObjectDisplay(new ClingDIDLParentContainer(parent)));
  for (Container item : didl.getContainers())
  {
    list.add(new DIDLObjectDisplay(new ClingDIDLContainer(item)));
    Log.v(TAG, "Add container : " + item.getTitle());
  }
  for (Item item : didl.getItems())
  {
    ClingDIDLItem clingItem = null;
    if(item instanceof VideoItem)
      clingItem = new ClingVideoItem((VideoItem)item);
    else if(item instanceof AudioItem)
      clingItem = new ClingAudioItem((AudioItem)item);
    else if(item instanceof ImageItem)
      clingItem = new ClingImageItem((ImageItem)item);
    else
      clingItem = new ClingDIDLItem(item);
    list.add(new DIDLObjectDisplay(clingItem));
    Log.v(TAG, "Add item : " + item.getTitle());
    for (DIDLObject.Property p : item.getProperties())
      Log.v(TAG, p.getDescriptorName() + " " + p.toString());
  }
  return list;
}
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: 4thline/cling

String genericType = genericItem.getClazz().getValue();
origin: hubing8658/UPnP-DLNA-Demo

public MItem(Item other) {
  super(other);
  setRefID(other.getRefID());
}
origin: tinyMediaManager/tinyMediaManager

url = didl.getItems().get(0).getResources().get(0).getValue();
origin: it.tidalwave.bluemarine2/it-tidalwave-bluemarine2-upnp-mediaserver

 @Override @Nonnull
 public final DIDLObject toObject()
  throws Exception
  {
   log.debug("toObject() - {}", datum);
   final DIDLObject item = datum.getDelegate().as(DIDLAdapter).toObject();
   if (item instanceof Item)
    {
     ((Item)item).setRefID(item.getId()); // don't externalize this
    }
   item.setId(externalized(datum.getPath().toString()));
   datum.getParent().ifPresent(parent -> item.setParentID(externalized(parent.getPath().toString())));
   return item;
  }
}
origin: trishika/DroidUPnP

final TrackMetadata trackMetadata = new TrackMetadata(upnpItem.getId(), upnpItem.getTitle(),
    upnpItem.getCreator(), "", "", upnpItem.getFirstResource().getValue(),
    "object.item." + type);
origin: kingthy/TVRemoteIME

  @Override
  protected boolean isLastElement(String uri, String localName, String qName) {
    if (DIDLContent.NAMESPACE_URI.equals(uri) && "item".equals(localName)) {
      if (getInstance().getTitle() == null) {
        log.warning("In DIDL content, missing 'dc:title' element for item: " + getInstance().getId());
      }
      if (getInstance().getClazz() == null) {
        log.warning("In DIDL content, missing 'upnp:class' element for item: " + getInstance().getId());
      }
      return true;
    }
    return false;
  }
}
origin: kingthy/TVRemoteIME

public static boolean isPictureItem(Item item) {
  // TODO zxt need check?
  String objectClass = item.getId();
  if (objectClass != null && objectClass.contains(DLNA_OBJECTCLASS_PHOTOID)) {
    return true;
  }
  return false;
}
org.fourthline.cling.support.model.itemItem

Most used methods

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

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top plugins for WebStorm
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