public class MessageFileEntity extends Object implements XMessageFileEntity
XMessageFileEntity
which
wraps MessageFile
instance in order to
provide the entity that used in the message format
MessageFileFormat
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
getAbsolutePath()
Gets the absolute path of the file system of the
XMessageFile 's underlying file |
String |
getFileName()
Gets the name of the underlying
XMessageFile |
FileStoreFeature |
getFileStoreFeature()
Gets the
FileStoreFeature instance which is originally
created the MessageFileEntity |
InputStream |
getInputStream()
Gets a new
FileInputStream to the underlying MessageFile 's
file each invocation to this method. |
OutputStream |
getOutputStream()
Gets a new
FileOutputStream to the underlying MessageFile 's
file each invocation to this method. |
FileChannel |
getReadFileChannel()
Gets a
FileChannel to the underlying MessageFile
file with read permissions, multiple calls to this
method will not create a new channel each time,
instead it will return the same read channel
which is cached at the MessageFile's level |
FileChannel |
getWriteFileChannel()
Gets a
FileChannel to the underlying MessageFile
file with write permissions, multiple calls to this
method will not create a new channel each time,
instead it will return the same write channel
which is cached at the MessageFile's level |
long |
length()
Gets the length of the underlying
XMessageFile |
public OutputStream getOutputStream() throws FileReleasedException, FileNotFoundException
XMessageFileEntity
FileOutputStream
to the underlying MessageFile
's
file each invocation to this method. returned output stream must
be closed at the end of the use.getOutputStream
in interface XMessageFileEntity
FileOutputStream
to the fileFileReleasedException
- if file is already releasedFileNotFoundException
- if file is not foundpublic FileChannel getReadFileChannel() throws FileReleasedException
XMessageFileEntity
FileChannel
to the underlying MessageFile
file with read permissions, multiple calls to this
method will not create a new channel each time,
instead it will return the same read channel
which is cached at the MessageFile's levelgetReadFileChannel
in interface XMessageFileEntity
FileReleasedException
- if file is already releasedpublic FileChannel getWriteFileChannel() throws FileReleasedException
XMessageFileEntity
FileChannel
to the underlying MessageFile
file with write permissions, multiple calls to this
method will not create a new channel each time,
instead it will return the same write channel
which is cached at the MessageFile's levelgetWriteFileChannel
in interface XMessageFileEntity
FileReleasedException
- if file is already releasedpublic InputStream getInputStream() throws FileReleasedException, FileNotFoundException
XMessageFileEntity
FileInputStream
to the underlying MessageFile
's
file each invocation to this method. returned input stream must
be closed at the end of the use.getInputStream
in interface XMessageFileEntity
FileInputStream
to the fileFileReleasedException
- if file is already releasedFileNotFoundException
- if file is not foundpublic FileStoreFeature getFileStoreFeature()
XMessageFileEntity
FileStoreFeature
instance which is originally
created the MessageFileEntitygetFileStoreFeature
in interface XMessageFileEntity
FileStoreFeature
public long length() throws FileReleasedException
XMessageFileEntity
XMessageFile
length
in interface XMessageFileEntity
FileReleasedException
- if file is already releasedpublic String getFileName()
XMessageFileEntity
XMessageFile
getFileName
in interface XMessageFileEntity
public String getAbsolutePath()
XMessageFileEntity
XMessageFile
's underlying filegetAbsolutePath
in interface XMessageFileEntity
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2016–2019 AdroitLogic. All rights reserved.