* modify the UPnP class to something we support and
* fetch_container took care of this already.
*/
- if (!container.create_classes.contains (didl_item.upnp_class) &&
+ if (!container.can_create (this.didl_item.upnp_class) &&
this.container_id != "DLNA_ORG.AnyContainer") {
throw new ContentDirectoryError.BAD_METADATA
("Creating of objects with class %s " +
/*
* Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>.
- * Copyright (C) 2010 Nokia Corporation.
+ * Copyright (C) 2010-2012 Nokia Corporation.
*
- * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
+ * Author: Jens Georg <jensg@openismus.com>
+ * Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
* <zeeshan.ali@nokia.com>
*
* This file is part of Rygel.
public abstract ArrayList<string> create_classes { get; set; }
/**
+ * Check if this container claims to be able to create an item with the
+ * given upnp class.
+ *
+ * @param upnp_class The class of an item to check
+ *
+ * @return true if it can, false, if not.ยจ
+ */
+ public bool can_create (string upnp_class) {
+ return this.create_classes.contains (upnp_class);
+ }
+
+ /**
* Add a new item directly under this container.
*
* This doesn't imply creation of file(s) pointed to by item's URI(s), that
}
public class Rygel.WritableContainer : Rygel.MediaContainer {
+ public bool can_create (string upnp_class) {
+ return this.create_classes.contains (upnp_class);
+ }
+
public async File? get_writable (Cancellable? cancellable = null) {
return File.new_for_commandline_arg ("/tmp");
}