Class DTDBasedZipArchiveXMLMagicNumber
- java.lang.Object
-
- org.arakhne.afc.inputoutput.filetype.MagicNumber
-
- org.arakhne.afc.inputoutput.filetype.ZipArchiveMagicNumber
-
- org.arakhne.afc.inputoutput.filetype.ZipArchiveXMLMagicNumber
-
- org.arakhne.afc.inputoutput.filetype.DTDBasedZipArchiveXMLMagicNumber
-
- All Implemented Interfaces:
Comparable<MagicNumber>
public class DTDBasedZipArchiveXMLMagicNumber extends ZipArchiveXMLMagicNumber
This class defines a set of informations that could distinguish a file content from another one. It is also known as Magic Number on several operating systems.This magic number supports an XML file inside a zip archive. It permits to test the DTD public and system identifiers.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:40
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- inputoutput
-
-
Constructor Summary
Constructors Constructor Description DTDBasedZipArchiveXMLMagicNumber(javax.activation.MimeType mimeType, String systemId, String publicId, File innerFile)
Constructor.DTDBasedZipArchiveXMLMagicNumber(javax.activation.MimeType mimeType, String systemId, String publicId, String formatVersion, File innerFile)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isContentType(String schemaId, String schemaVersion, String systemId, String publicId)
Replies if the specified stream contains data that corresponds to this magic number.-
Methods inherited from class org.arakhne.afc.inputoutput.filetype.ZipArchiveXMLMagicNumber
isContentType
-
Methods inherited from class org.arakhne.afc.inputoutput.filetype.ZipArchiveMagicNumber
doStreamEncoding, isContentType, undoStreamEncoding
-
Methods inherited from class org.arakhne.afc.inputoutput.filetype.MagicNumber
compareTo, getFormatVersion, getHostMimeTypes, getMimeType
-
-
-
-
Constructor Detail
-
DTDBasedZipArchiveXMLMagicNumber
public DTDBasedZipArchiveXMLMagicNumber(javax.activation.MimeType mimeType, String systemId, String publicId, String formatVersion, File innerFile)
Constructor.- Parameters:
mimeType
- is the MIME type associated to this magic number.systemId
- is the DTD system ID associated to this magic number.publicId
- is the DTD system ID associated to this magic number.formatVersion
- is the version of the supported format.innerFile
- is the file to open from the inside of the Zip archive to test the type. The filename is relative to the root of the zip file content.
-
DTDBasedZipArchiveXMLMagicNumber
public DTDBasedZipArchiveXMLMagicNumber(javax.activation.MimeType mimeType, String systemId, String publicId, File innerFile)
Constructor.- Parameters:
mimeType
- is the MIME type associated to this magic number.systemId
- is the DTD system ID associated to this magic number.publicId
- is the DTD system ID associated to this magic number.innerFile
- is the file to open from the inside of the Zip archive to test the type. The filename is relative to the root of the zip file content.
-
-
Method Detail
-
isContentType
protected boolean isContentType(String schemaId, String schemaVersion, String systemId, String publicId)
Replies if the specified stream contains data that corresponds to this magic number.- Specified by:
isContentType
in classZipArchiveXMLMagicNumber
- Parameters:
schemaId
- is the ID of the XSL schema associated to this magic number.schemaVersion
- is the ID of the XSL schema associated to this magic number.systemId
- is the DTD system ID associated to this magic number.publicId
- is the DTD system ID associated to this magic number.- Returns:
true
if this magic number is corresponding to the given XML document, otherwisefalse
-
-