java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
org.esau.ptarmigan.impl.filter.BaseFilter
org.esau.ptarmigan.impl.filter.BinaryFilter
org.esau.ptarmigan.impl.filter.ID3v1Filter
- All Implemented Interfaces:
- org.esau.ptarmigan.impl.ByteStreamSource, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.esau.ptarmigan.impl.RandomAccessFileSource, org.xml.sax.XMLFilter, org.xml.sax.XMLReader
- public final class ID3v1Filter
- extends BinaryFilter
- implements org.esau.ptarmigan.impl.RandomAccessFileSource
Extract metadata from an ID3v1 tag
It's a 128-byte block at the end of a file.
May appear on MP3, Ogg, Flac, and other files.
Note that it is unsupported with streams, at least for now. This
is because of the overhead required in scanning to the end of the file.
- Version:
- $Revision: 1.4 $ $Date: 2002/09/19 03:42:01 $
| Methods inherited from class org.esau.ptarmigan.impl.filter.BinaryFilter |
counter, doParse, fastForward, read, read, read, readCharBE, readCharLE, readInt16BE, readInt16LE, readInt24BE, readInt24LE, readInt32BE, readInt32LE, remaining, rewind, setCounterLimit, skip |
| Methods inherited from class org.esau.ptarmigan.impl.filter.BaseFilter |
characters, getChars, getMediaProperties, parse, setMediaProperties, sourceIsXML, write, write, write, write, write, write, write, write, write, write, write, writeDate, writeDate, writeDate, writeDate, writeInteger, writeInteger, writeInteger, writeInteger, writeInteger, writeString, writeString, writeString, writeString, writeString |
| Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ID3V1_TAG_LENGTH
static final int ID3V1_TAG_LENGTH
- See Also:
- Constant Field Values
ITEM_TAG_LENGTH
static final int ITEM_TAG_LENGTH
- See Also:
- Constant Field Values
ITEM_TITLE_LENGTH
static final int ITEM_TITLE_LENGTH
- See Also:
- Constant Field Values
ITEM_ARTIST_LENGTH
static final int ITEM_ARTIST_LENGTH
- See Also:
- Constant Field Values
ITEM_ALBUM_LENGTH
static final int ITEM_ALBUM_LENGTH
- See Also:
- Constant Field Values
ITEM_YEAR_LENGTH
static final int ITEM_YEAR_LENGTH
- See Also:
- Constant Field Values
ITEM_COMMENT_LENGTH
static final int ITEM_COMMENT_LENGTH
- See Also:
- Constant Field Values
m_file
java.io.File m_file
ID3_MARKER
static final byte[] ID3_MARKER
NS_URI
static final java.lang.String NS_URI
- See Also:
- Constant Field Values
NS_PREFIX
static final java.lang.String NS_PREFIX
- See Also:
- Constant Field Values
log
static org.apache.commons.logging.Log log
- logging object
ID3v1Filter
public ID3v1Filter()
throws org.xml.sax.SAXException
getNamespaceURI
java.lang.String getNamespaceURI()
- Specified by:
getNamespaceURI in class BaseFilter
getNamespacePrefix
java.lang.String getNamespacePrefix()
- Specified by:
getNamespacePrefix in class BaseFilter
doParse
public void doParse()
throws org.xml.sax.SAXException,
java.io.IOException,
java.text.ParseException
- SAX-Invoked parse of a 'document' from an input stream.
Note that the caller must already have called this.getByteStream()
to obtain the raw data for the tag.
This module creates the document from the parsed ID3V1 metadata.
- Specified by:
doParse in class BinaryFilter
writeID3v1
void writeID3v1()
throws java.io.IOException,
org.xml.sax.SAXException,
java.text.ParseException
- build the xml content
getByteStream
java.io.InputStream getByteStream(java.lang.String system_id)
throws java.io.IOException,
org.xml.sax.SAXException
- obtain the id3 tag as a stream of bytes, for handy parsing
Many different filetypes may have an ID3v1 tag (128 bytes)
attached to their end.
- Overrides:
getByteStream in class BaseFilter
maybeWrite
void maybeWrite(byte[] buf,
int length,
java.lang.String xml_name)
throws java.io.IOException,
org.xml.sax.SAXException