| Modifier and Type | Field and Description |
|---|---|
static ResourceFactory |
FACTORY |
| Constructor and Description |
|---|
BinaryResource(String href,
String contentType,
InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Get the media type (MIME type) of the resource if known
|
Item |
getItem(XPathContext context)
Get an XDM Item holding the contents of this resource.
|
String |
getResourceURI()
Get a URI that identifies this resource
|
static byte[] |
readBinary(File file,
String path) |
static byte[] |
readBinaryFromStream(InputStream in,
String path) |
void |
setData(byte[] data) |
public static final ResourceFactory FACTORY
public BinaryResource(String href, String contentType, InputStream in)
public void setData(byte[] data)
public String getResourceURI()
ResourcegetResourceURI in interface Resourcepublic static byte[] readBinaryFromStream(InputStream in, String path) throws XPathException
XPathExceptionpublic static byte[] readBinary(File file, String path) throws XPathException
XPathExceptionpublic Item getItem(XPathContext context) throws XPathException
ResourcegetItem in interface Resourcecontext - the XPath evaluation contextXPathException - if a failure occurs materializing the resourcepublic String getContentType()
ResourcegetContentType in interface ResourceCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.