Class RssEnclosure

java.lang.Object
com.oorian.rss.RssEnclosure

public class RssEnclosure extends Object
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 Details

    • RssEnclosure

      public RssEnclosure(String url, long length, String type)
      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

      public String getUrl()
    • getLength

      public long getLength()
    • getType

      public String getType()
    • toXmlElement

      public com.oorian.xml.XmlElement toXmlElement()
      Converts this enclosure to a self-closing XmlElement.
      Returns:
      An XmlElement representing this <enclosure> element.