Package com.oorian.rss
Class RssEnclosure
java.lang.Object
com.oorian.rss.RssEnclosure
Represents an RSS
<enclosure> element for media attachments.
Enclosures describe media objects (audio, video, images) attached to an RSS item. All three attributes (url, length, type) are required by the RSS 2.0 specification.
Usage:
RssEnclosure enclosure = new RssEnclosure(
"https://example.com/podcast/episode1.mp3",
12345678L,
"audio/mpeg"
);
- Since:
- 0.1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRssEnclosure(String url, long length, String type) Creates an enclosure with the specified URL, length, and MIME type. -
Method Summary
-
Constructor Details
-
RssEnclosure
Creates an enclosure with the specified URL, length, and MIME type.- Parameters:
url- The URL of the enclosed media object.length- The size of the media object in bytes.type- The MIME type of the media object (e.g., "audio/mpeg", "video/mp4").
-
-
Method Details
-
getUrl
-
getLength
public long getLength() -
getType
-
toXmlElement
public com.oorian.xml.XmlElement toXmlElement()Converts this enclosure to a self-closingXmlElement.- Returns:
- An XmlElement representing this
<enclosure>element.
-