org.olat.core.util.vfs.version
Class VersionsFileImpl

java.lang.Object
  extended by org.olat.core.util.vfs.version.VersionsFileImpl
All Implemented Interfaces:
Versions

public class VersionsFileImpl
extends java.lang.Object
implements Versions

Description:
This class implements the @see org.olat.core.util.vfs.version.Versions for a file which is versioned. The attributes versionFile and currentVersion are set by the VersionsFilemanager.

Initial Date: 21 sept. 2009

Author:
srosse

Constructor Summary
VersionsFileImpl()
           
 
Method Summary
 boolean addVersion(Identity identity, java.lang.String comment, java.io.InputStream newVersion)
          add a new version of the file
 boolean delete(Identity identity, java.util.List<VFSRevision> revisionsToDelete)
          Delete the list of revisions given as parameter
 java.lang.String getAuthor()
           
 java.lang.String getComment()
           
 java.lang.String getCreator()
           
 Versionable getCurrentVersion()
           
 java.lang.String getRevisionNr()
           
 java.util.List<VFSRevision> getRevisions()
           
 VFSLeaf getVersionFile()
           
 boolean isVersioned()
           
 boolean move(VFSContainer container)
          move the file
 boolean restore(Identity identity, VFSRevision version, java.lang.String comment)
          restore the file to the revision given as parameter
 void setAuthor(java.lang.String author)
           
 void setComment(java.lang.String comment)
           
 void setCreator(java.lang.String creator)
           
 void setCurrentVersion(Versionable currentVersion)
           
 void setRevisionNr(java.lang.String revisionNr)
           
 void setRevisions(java.util.List<VFSRevision> revisions)
           
 void setVersionFile(VFSLeaf versionFile)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionsFileImpl

public VersionsFileImpl()
Method Detail

getRevisionNr

public java.lang.String getRevisionNr()
Specified by:
getRevisionNr in interface Versions
Returns:
the current version number

setRevisionNr

public void setRevisionNr(java.lang.String revisionNr)

getVersionFile

public VFSLeaf getVersionFile()

setVersionFile

public void setVersionFile(VFSLeaf versionFile)

getCurrentVersion

public Versionable getCurrentVersion()

setCurrentVersion

public void setCurrentVersion(Versionable currentVersion)

addVersion

public boolean addVersion(Identity identity,
                          java.lang.String comment,
                          java.io.InputStream newVersion)
Description copied from interface: Versions
add a new version of the file

Specified by:
addVersion in interface Versions
Returns:

move

public boolean move(VFSContainer container)
Description copied from interface: Versions
move the file

Specified by:
move in interface Versions
Returns:

restore

public boolean restore(Identity identity,
                       VFSRevision version,
                       java.lang.String comment)
Description copied from interface: Versions
restore the file to the revision given as parameter

Specified by:
restore in interface Versions
Returns:

delete

public boolean delete(Identity identity,
                      java.util.List<VFSRevision> revisionsToDelete)
Description copied from interface: Versions
Delete the list of revisions given as parameter

Specified by:
delete in interface Versions
Returns:

getRevisions

public java.util.List<VFSRevision> getRevisions()
Specified by:
getRevisions in interface Versions
Returns:
the list of revisions

setRevisions

public void setRevisions(java.util.List<VFSRevision> revisions)

isVersioned

public boolean isVersioned()
Specified by:
isVersioned in interface Versions
Returns:
true if the file is versioned

getAuthor

public java.lang.String getAuthor()

setAuthor

public void setAuthor(java.lang.String author)

getCreator

public java.lang.String getCreator()
Specified by:
getCreator in interface Versions
Returns:
creator of the file

setCreator

public void setCreator(java.lang.String creator)

getComment

public java.lang.String getComment()
Specified by:
getComment in interface Versions
Returns:
comment on the current version

setComment

public void setComment(java.lang.String comment)