public class OrdFileSource extends java.lang.Object implements OrdContentSource
OrdContentSource
to support using a file as the content source for deferred
loading.Constructor and Description |
---|
OrdFileSource(java.lang.String fileName)
Constructs an
OrdFileSource instance. |
Modifier and Type | Method and Description |
---|---|
void |
deleteFileInRelease()
Indicates the file should be deleted when
release()
is invoked. |
int |
getContentLength()
Gets the length of the file.
|
java.lang.String |
getFileName()
Gets the file name which refers to a file containing the content
to be loaded.
|
java.io.InputStream |
getInputStream()
Gets an
InputStream object pointing to the file. |
java.lang.String |
getMimeType()
Gets the
MIME type of the content. |
boolean |
isDeleteFileInRelease()
Returns whether the file will be deleted when
release()
is invoked. |
void |
release()
Releases the resources used by the content source.
|
void |
setFileName(java.lang.String fileName)
Sets a file name which refers to a file containing the
content to be loaded.
|
void |
setMimeType(java.lang.String mimeType)
Sets the
MIME type of the content. |
public OrdFileSource(java.lang.String fileName)
OrdFileSource
instance.fileName
- a file name which refers to a file containing
the content to be loadedpublic void setFileName(java.lang.String fileName)
fileName
- a file name stringpublic java.lang.String getFileName()
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
object pointing to the file.getInputStream
in interface OrdContentSource
FileInputStream
objectjava.io.IOException
public int getContentLength() throws java.io.IOException
getContentLength
in interface OrdContentSource
java.io.IOException
public void setMimeType(java.lang.String mimeType)
MIME
type of the content.mimeType
- the MIME
type of the contentpublic java.lang.String getMimeType()
MIME
type of the content. If the
MIME
type was not set by
a previous setMimeType(String)
call, it returns
null
.getMimeType
in interface OrdContentSource
MIME
typepublic void deleteFileInRelease()
release()
is invoked.public boolean isDeleteFileInRelease()
release()
is invoked.public void release()
OrdContentSource
release
in interface OrdContentSource