org.scribble.common.resource
Class FileContent

java.lang.Object
  extended by org.scribble.common.resource.FileContent
All Implemented Interfaces:
Content

public class FileContent
extends Object
implements Content

This class represents file content to be used by the Scribble tools.


Constructor Summary
FileContent(File file)
          This construct is initialized with the file.
 
Method Summary
 InputStream getInputStream()
          This method returns the input stream for accessing the content.
 String getName()
          This method returns the content name if available.
 boolean hasExtension(String ext)
          This method determines whether the content has an extension of the specified type.
 boolean isXSDElement(QName xsdElem)
          This method determines whether the content is an XSD element of the value specified.
 boolean isXSDType(QName xsdType)
          This method determines whether the content is an XSD type of the value specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileContent

public FileContent(File file)
This construct is initialized with the file.

Parameters:
file - The file
Method Detail

getName

public String getName()
This method returns the content name if available.

Specified by:
getName in interface Content
Returns:
The optional content name

getInputStream

public InputStream getInputStream()
                           throws IOException
This method returns the input stream for accessing the content.

Specified by:
getInputStream in interface Content
Returns:
The input stream
Throws:
IOException - Failed to get input stream

hasExtension

public boolean hasExtension(String ext)
This method determines whether the content has an extension of the specified type.

Specified by:
hasExtension in interface Content
Parameters:
ext - The extension
Returns:
Whether the content has the specified extension

isXSDType

public boolean isXSDType(QName xsdType)
This method determines whether the content is an XSD type of the value specified.

Specified by:
isXSDType in interface Content
Parameters:
xsdType - The XSD type name
Returns:
Whether the content is an XSD type of the specified name

isXSDElement

public boolean isXSDElement(QName xsdElem)
This method determines whether the content is an XSD element of the value specified.

Specified by:
isXSDElement in interface Content
Parameters:
xsdElem - The XSD element name
Returns:
Whether the content is an XSD element of the specified name


Copyright © 2008-Present Scribble.org. All Rights Reserved.