org.openl.rules.repository
Interface RFile

All Superinterfaces:
REntity

public interface RFile
extends REntity

OpenL Rules File. It stores content of physical files.

Author:
Aleh Bykhavets

Method Summary
 InputStream getContent()
          Gets content of the file.
 InputStream getContent4Version(CommonVersion version)
          Returns content of specified version of the file.
 String getMimeType()
          Gets mime type of the file.
 long getSize()
          Returns size of the file's content in bytes.
 void revertToVersion(String versionName)
          Reverts the file to specified version.
 void setContent(InputStream inputStream)
          Sets/Updates content of the file.
 
Methods inherited from interface org.openl.rules.repository.REntity
addProperty, delete, getActiveVersion, getEffectiveDate, getExpirationDate, getLineOfBusiness, getName, getPath, getProperties, getProperty, getProps, getVersionHistory, hasProperty, removeProperty, setEffectiveDate, setExpirationDate, setLineOfBusiness, setProps
 

Method Detail

getContent

InputStream getContent()
                       throws RRepositoryException
Gets content of the file. It is highly apreciated to close stream right after it is no longer needed.

Returns:
content stream with content of file
Throws:
RRepositoryException - if failed

getContent4Version

InputStream getContent4Version(CommonVersion version)
                               throws RRepositoryException
Returns content of specified version of the file.

Parameters:
version - specified version
Returns:
content of specified version
Throws:
RRepositoryException - if failed

getMimeType

String getMimeType()
Gets mime type of the file.

Returns:
mime type

getSize

long getSize()
Returns size of the file's content in bytes.

Returns:
size of content or -1 if cannot determine it.

revertToVersion

void revertToVersion(String versionName)
                     throws RRepositoryException
Reverts the file to specified version.

Parameters:
versionName - name of version
Throws:
RRepositoryException - if failed

setContent

void setContent(InputStream inputStream)
                throws RRepositoryException
Sets/Updates content of the file. At the end input stream will be closed.

Parameters:
inputStream - stream with new content of the file
Throws:
RModifyException - if failed
RRepositoryException


Copyright © 2010. All Rights Reserved.