sharpster.daemon.sharemanagement
Class ShareManager

java.lang.Object
  |
  +--sharpster.daemon.sharemanagement.ShareManager

public class ShareManager
extends java.lang.Object

Class responsible for the overall management of file shares.


Constructor Summary
ShareManager()
           
 
Method Summary
 sharpster.common.ResponseCollection checkAccess(sharpster.common.FileCollection files, java.lang.String user, int access)
           
 sharpster.common.ResponseCollection getSharedFiles(java.lang.String user)
           
 boolean hasDeleteAccess(sharpster.common.FileCollection files, java.lang.String user)
          Check if a user has remove access to the specified files.
 boolean hasReadAccess(sharpster.common.FileCollection files, java.lang.String user)
          Check if a user has read access to the specified files.
 boolean hasWriteAccess(sharpster.common.FileCollection files, java.lang.String user)
          Check if a user has write access to the specified files.
 void initialize(sharpster.daemon.filemanagement.FileManager fm, sharpster.daemon.usermanagement.UserManager um, sharpster.daemon.groupmanagement.GroupController gc)
           
 boolean loadFromFile(java.lang.String filepath)
           
 void removeSharesWithFile(net.jxta.id.ID fileID)
           
 boolean saveToFile(java.lang.String filepath)
           
 sharpster.common.ResponseCollection shareFiles(sharpster.common.FileCollection files, boolean recursive)
          Store the specified file share.
 void synchronizeShares()
           
 sharpster.common.ResponseCollection unshareFiles(sharpster.common.FileCollection files, boolean recursive)
           
 sharpster.common.ResponseCollection viewFileSharing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShareManager

public ShareManager()
Method Detail

initialize

public void initialize(sharpster.daemon.filemanagement.FileManager fm,
                       sharpster.daemon.usermanagement.UserManager um,
                       sharpster.daemon.groupmanagement.GroupController gc)

shareFiles

public sharpster.common.ResponseCollection shareFiles(sharpster.common.FileCollection files,
                                                      boolean recursive)
Store the specified file share. If recursive is true, the share operates recursively.


unshareFiles

public sharpster.common.ResponseCollection unshareFiles(sharpster.common.FileCollection files,
                                                        boolean recursive)

removeSharesWithFile

public void removeSharesWithFile(net.jxta.id.ID fileID)

synchronizeShares

public void synchronizeShares()

getSharedFiles

public sharpster.common.ResponseCollection getSharedFiles(java.lang.String user)

viewFileSharing

public sharpster.common.ResponseCollection viewFileSharing()

checkAccess

public sharpster.common.ResponseCollection checkAccess(sharpster.common.FileCollection files,
                                                       java.lang.String user,
                                                       int access)

hasReadAccess

public boolean hasReadAccess(sharpster.common.FileCollection files,
                             java.lang.String user)
Check if a user has read access to the specified files.


hasWriteAccess

public boolean hasWriteAccess(sharpster.common.FileCollection files,
                              java.lang.String user)
Check if a user has write access to the specified files.


hasDeleteAccess

public boolean hasDeleteAccess(sharpster.common.FileCollection files,
                               java.lang.String user)
Check if a user has remove access to the specified files.


loadFromFile

public boolean loadFromFile(java.lang.String filepath)

saveToFile

public boolean saveToFile(java.lang.String filepath)