org.jmonks.dms.versioncontrol.api
Interface FileEntry

All Superinterfaces:
RepositoryEntry
All Known Implementing Classes:
DefaultFileEntry

public interface FileEntry
extends RepositoryEntry

Author:
Suresh Pragada This represents interface to the File Entry in repository. It lets the users to do all core activities related to File Entry like getting the required version, get all the versions of this entry, checking out and chekcing in the file.

Method Summary
 boolean cancelCheckOut()
          Cancels the reservation made to edit the file.
 FileVersion checkin(java.lang.String authorName, java.util.Date versionDate, java.lang.String description, java.io.InputStream inputStream)
          Checks in the file as a latest version of the file.
 boolean checkOut()
          Reserves the file for edit.
 java.util.List getAllVersions()
          Returns the list, which contains all the versions of the File Entry.
 FileVersion getVersion(int versionNum)
          Gets the requested version of file File Entry as an FileVersion object.
 int getVersionCount()
          Returns the number of versions exists for this entry.
 boolean isCheckedOut()
          Tells whether the file has been checked out for edit or not.
 
Methods inherited from interface org.jmonks.dms.versioncontrol.api.RepositoryEntry
cancelDelete, delete, getDeletedDate, getEntryID, getEntryName, getEntryType, getParentEntryID, getParentRepositoryEntry, isDeleted, remove
 

Method Detail

getAllVersions

public java.util.List getAllVersions()
Returns the list, which contains all the versions of the File Entry. This list will contains the FileVersion objects.

Returns:
Returns the list contains all the file versions.

isCheckedOut

public boolean isCheckedOut()
Tells whether the file has been checked out for edit or not.

Returns:
Returns true if file has been checked out for edit, false, otherwise.

getVersion

public FileVersion getVersion(int versionNum)
Gets the requested version of file File Entry as an FileVersion object.

Parameters:
versionNum - Required version of the file. The first version of the file start with 1. So, this should be in between the 1 and total number of versions.
Returns:
Returns the FileVersion object of that particular version.

checkin

public FileVersion checkin(java.lang.String authorName,
                           java.util.Date versionDate,
                           java.lang.String description,
                           java.io.InputStream inputStream)
Checks in the file as a latest version of the file. It does require all the metadata to construct the next version. The file which needs to be checked-in should be provided as an java.io.InputStream.

Parameters:
authorName - Author name to be stored in meta info of this version.
versionDate - Version created date to be stored in meta info of this version.
description - Description to be stored in meta info of this version.
inputStream - InputStream of the information needs to be checked-in as the latest version.
Returns:
Returns the checked-in FileVersion object. This is the latest version.

cancelCheckOut

public boolean cancelCheckOut()
Cancels the reservation made to edit the file.

Returns:
Returns true if reservation has been cancelled, false, otherwise.

checkOut

public boolean checkOut()
Reserves the file for edit.


getVersionCount

public int getVersionCount()
Returns the number of versions exists for this entry.

Returns:
Returns the no of version exists.