org.jmonks.dms.versioncontrol.ri
Class DefaultFileVersion

java.lang.Object
  extended byorg.jmonks.dms.versioncontrol.ri.DefaultFileVersion
All Implemented Interfaces:
FileVersion

public class DefaultFileVersion
extends java.lang.Object
implements FileVersion

Author:
Suresh Pragada This class represents particular version of file entry. This provides methods to access all meta information and access the actual content.

Field Summary
protected  java.lang.String fileName
           
(package private)  org.apache.log4j.Logger logger
           
protected  java.lang.String versionAuthor
           
protected  java.util.Date versionDate
           
protected  java.lang.String versionDescription
           
protected  int versionNumber
           
 
Constructor Summary
(package private) DefaultFileVersion(int versionNumber, java.lang.String versionDate, java.lang.String authorName, java.lang.String description, java.lang.String fileName)
          Creates a new instance of DefaultFileVersion.
 
Method Summary
 java.io.InputStream getInputStream()
          This method will allow to read the contents of that particular version of that file entry.
 int getLength()
          Returns the length of the file of this version.
 java.lang.String getVersionAuthor()
          Returns the author of version of this object.
 java.util.Date getVersionDate()
          Returns the created date of this version.
 java.lang.String getVersionDescription()
          Returns the description of this version.
 int getVersionNumber()
          Returns the number of version this object holds.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionNumber

protected int versionNumber

versionDate

protected java.util.Date versionDate

versionAuthor

protected java.lang.String versionAuthor

versionDescription

protected java.lang.String versionDescription

fileName

protected java.lang.String fileName

logger

org.apache.log4j.Logger logger
Constructor Detail

DefaultFileVersion

DefaultFileVersion(int versionNumber,
                   java.lang.String versionDate,
                   java.lang.String authorName,
                   java.lang.String description,
                   java.lang.String fileName)
Creates a new instance of DefaultFileVersion.

Parameters:
versionNumber - Number of this particular version
versionDate - Date created this version.
authorName - Name of the author created this version.
description - Description provided when submitting this version.
fileName - Entry name of the file entry.
Method Detail

getVersionNumber

public int getVersionNumber()
Description copied from interface: FileVersion
Returns the number of version this object holds.

Specified by:
getVersionNumber in interface FileVersion
Returns:
Retuns the version number of this object.
See Also:
FileVersion.getVersionNumber()

getVersionDate

public java.util.Date getVersionDate()
Description copied from interface: FileVersion
Returns the created date of this version.

Specified by:
getVersionDate in interface FileVersion
Returns:
Retuns the created date as java.util.Date.
See Also:
FileVersion.getVersionDate()

getVersionAuthor

public java.lang.String getVersionAuthor()
Description copied from interface: FileVersion
Returns the author of version of this object.

Specified by:
getVersionAuthor in interface FileVersion
Returns:
Retuns the author of this version.
See Also:
FileVersion.getVersionAuthor()

getVersionDescription

public java.lang.String getVersionDescription()
Description copied from interface: FileVersion
Returns the description of this version.

Specified by:
getVersionDescription in interface FileVersion
Returns:
Retuns the description of this version.
See Also:
FileVersion.getVersionDescription()

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: FileVersion
This method will allow to read the contents of that particular version of that file entry.

Specified by:
getInputStream in interface FileVersion
Returns:
InputStream of contents of that version.
See Also:
FileVersion.getInputStream()

getLength

public int getLength()
Description copied from interface: FileVersion
Returns the length of the file of this version. This will be used in downloads to specifiy the length of the file being downloaded.

Specified by:
getLength in interface FileVersion
Returns:
Returns the number of bytes to be downloaded.
See Also:
FileVersion.getLength()

toString

public java.lang.String toString()
See Also:
Object.toString()