org.pentaho.platform.repository.content
Class ContentItemFile

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.repository.content.ContentItemFile
All Implemented Interfaces:
Serializable, ILogger, IContentItemFile

public class ContentItemFile
extends PentahoBase
implements IContentItemFile

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Method Summary
 long copyToFile(String newFileName)
          Copies the latest file to another location
 boolean deleteOsFile()
          Deletes the file in the Operating System
 boolean equals(Object other)
           
 String getActionName()
           
 Date getFileDateTime()
           
 long getFileSize()
           
 String getId()
           
 int getInitialized()
           
 InputStream getInputStream()
           
 File getItemFile()
           
 org.apache.commons.logging.Log getLogger()
           
 List getMessages()
           
 String getOsFileName()
           
 String getOsPath()
           
 OutputStream getOutputStream(boolean overWriteOk)
           
 OutputStream getOutputStream(boolean overWriteOk, boolean append)
           
 ContentItem getParent()
           
 Reader getReader()
           
 int getRevision()
           
 int hashCode()
           
 void setActionName(String actionName)
           
 void setFileSize(long fileSize)
           
 void setId(String id)
           
 void setInitialized(int initialized)
           
 void setItemFile(File itemFile)
           
 void setOsFileName(String osFileName)
           
 void setOsPath(String osPath)
           
 void setParent(ContentItem parent)
           
 void setRevision(int revision)
           
 String toString()
           
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
debug, debug, error, error, fatal, fatal, genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, info, info, setLoggingLevel, setLogId, trace, trace, warn, warn
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getMessages

public List getMessages()

getRevision

public int getRevision()
Returns:
Returns the revision.

setRevision

public void setRevision(int revision)
Parameters:
revision - The revision to set.

getInputStream

public InputStream getInputStream()
                           throws ContentException
Specified by:
getInputStream in interface IContentItemFile
Returns:
An input stream from the file on disk
Throws:
ContentException

getReader

public Reader getReader()
                 throws ContentException
Specified by:
getReader in interface IContentItemFile
Returns:
A Reader from the file on disk.
Throws:
ContentException

getOutputStream

public OutputStream getOutputStream(boolean overWriteOk)
                             throws ContentException
Specified by:
getOutputStream in interface IContentItemFile
Parameters:
overWriteOk - Indicates whether overwriting the file on disk is ok. (determined by the write mode of the containing ContentItem).
Returns:
An OutputStream to write to
Throws:
ContentException

getOutputStream

public OutputStream getOutputStream(boolean overWriteOk,
                                    boolean append)
                             throws ContentException
Specified by:
getOutputStream in interface IContentItemFile
Parameters:
overWriteOk - Indicates whether overwriting the file on disk is ok. (determined by the write mode of the containing ContentItem).
append - Indicates whether to append to the file.
Returns:
An OutputStream to write to
Throws:
ContentException

copyToFile

public long copyToFile(String newFileName)
                throws ContentException
Description copied from interface: IContentItemFile
Copies the latest file to another location

Specified by:
copyToFile in interface IContentItemFile
Parameters:
newFileName - File name to copy to. Must be fully qualified.
Returns:
Number of bytes copied
Throws:
ContentException

deleteOsFile

public boolean deleteOsFile()
Description copied from interface: IContentItemFile
Deletes the file in the Operating System

Specified by:
deleteOsFile in interface IContentItemFile
Returns:
Success indicator

getParent

public ContentItem getParent()
Returns:
Returns the parent.

setParent

public void setParent(ContentItem parent)
Parameters:
parent - The parent to set.

getActionName

public String getActionName()
Specified by:
getActionName in interface IContentItemFile
Returns:
Returns the actionName.

setActionName

public void setActionName(String actionName)
Parameters:
actionName - The actionName to set.

getFileDateTime

public Date getFileDateTime()
Specified by:
getFileDateTime in interface IContentItemFile
Returns:
Returns the fileDateTime.

getFileSize

public long getFileSize()
Specified by:
getFileSize in interface IContentItemFile
Returns:
Returns the fileSize.

setFileSize

public void setFileSize(long fileSize)
Parameters:
fileSize - The fileSize to set.

getId

public String getId()
Specified by:
getId in interface IContentItemFile
Returns:
Returns the id.

setId

public void setId(String id)
Parameters:
id - The id to set.

getOsFileName

public String getOsFileName()
Specified by:
getOsFileName in interface IContentItemFile
Returns:
Returns the osFileName.

setOsFileName

public void setOsFileName(String osFileName)
Parameters:
osFileName - The osFileName to set.

getOsPath

public String getOsPath()
Specified by:
getOsPath in interface IContentItemFile
Returns:
Returns the osPath.

setOsPath

public void setOsPath(String osPath)
Parameters:
osPath - The osPath to set.

getInitialized

public int getInitialized()
Returns:
Returns the initialized.

setInitialized

public void setInitialized(int initialized)
Parameters:
initialized - The initialized to set.

getItemFile

public File getItemFile()
Returns:
Returns the itemFile.

setItemFile

public void setItemFile(File itemFile)
Parameters:
itemFile - The itemFile to set.

getLogger

public org.apache.commons.logging.Log getLogger()
Specified by:
getLogger in class PentahoBase

toString

public String toString()
Overrides:
toString in class Object