fr.paris.lutece.plugins.jsr170.business
Class RepositoryFileHome

java.lang.Object
  extended by fr.paris.lutece.plugins.jsr170.business.RepositoryFileHome

public class RepositoryFileHome
extends java.lang.Object


Constructor Summary
RepositoryFileHome()
           
 
Method Summary
 void addFile(java.lang.String strWorkspace, java.lang.String path, java.io.File file)
          Create a file in workspace strWorkspace in directory designed by path with content file
 boolean canAccess(java.lang.String strWorkspace, java.lang.String strAccessType, java.lang.String[] userRoles)
          Tests if the workspace strWorkspace can be accessed with roles in userRoles and access of type strAccessType
 void createFolder(java.lang.String strWorkspace, java.lang.String path)
          Create a directory in workspace strWorkspace at location path
 void createWorkspace(java.lang.String strWorkspaceName)
          Create a new workspace
 java.util.Map<java.lang.String,java.lang.Boolean> getAvailableAccess(java.lang.String strWorkspace, java.lang.String[] userRoles)
          Get all available access, given some roles
 fr.paris.lutece.util.ReferenceList getAvailableWorkspaces()
          Get all available workspaces
static RepositoryFileHome getInstance()
          Returns the instance of the singleton
 IRepositoryFile getRepositoryFile(java.lang.String strWorkspace, java.lang.String path)
          Get the file in workspace strWorkspace in directory path
 java.util.List<IRepositoryFile> getRepositoryFileList(java.lang.String strWorkspace)
          Get the files in workspace strWorkspace
 java.util.List<IRepositoryFile> getRepositoryFileList(java.lang.String strWorkspace, java.lang.String parent)
          Get the files in workspace strWorkspace in directory parent
 IWorkspace getWorkspace(java.lang.String strWorkspace)
          Get workspace informations
 void modify(IWorkspace workspace)
          Modify workspace acces rights
 void removeRepositoryFile(java.lang.String strWorkspace, java.lang.String strPath)
          Remove element in workspace strWorkspace at path strPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryFileHome

public RepositoryFileHome()
Method Detail

getInstance

public static RepositoryFileHome getInstance()
Returns the instance of the singleton

Returns:
The instance of the singleton

getRepositoryFileList

public java.util.List<IRepositoryFile> getRepositoryFileList(java.lang.String strWorkspace)
Get the files in workspace strWorkspace

Parameters:
strWorkspace - the workspace name
Returns:
a list of IRepositoryFile

getRepositoryFile

public IRepositoryFile getRepositoryFile(java.lang.String strWorkspace,
                                         java.lang.String path)
Get the file in workspace strWorkspace in directory path

Parameters:
strWorkspace - the workspace name
path - an absolute path to the directory
Returns:
the IRepositoryFile

getRepositoryFileList

public java.util.List<IRepositoryFile> getRepositoryFileList(java.lang.String strWorkspace,
                                                             java.lang.String parent)
Get the files in workspace strWorkspace in directory parent

Parameters:
strWorkspace - the workspace name
parent - the parent directory absolute path
Returns:
a list of IRepositoryFile

addFile

public void addFile(java.lang.String strWorkspace,
                    java.lang.String path,
                    java.io.File file)
Create a file in workspace strWorkspace in directory designed by path with content file

Parameters:
strWorkspace - the workspace name
path - the parent directory absolute path
file - the file content

createFolder

public void createFolder(java.lang.String strWorkspace,
                         java.lang.String path)
Create a directory in workspace strWorkspace at location path

Parameters:
strWorkspace - the workspace name
path - the directory absolute path

removeRepositoryFile

public void removeRepositoryFile(java.lang.String strWorkspace,
                                 java.lang.String strPath)
Remove element in workspace strWorkspace at path strPath

Parameters:
strWorkspace - the workspace name
strPath - the absolute path

getAvailableWorkspaces

public fr.paris.lutece.util.ReferenceList getAvailableWorkspaces()
Get all available workspaces

Returns:
a ReferenceList with all workspace names

createWorkspace

public void createWorkspace(java.lang.String strWorkspaceName)
Create a new workspace

Parameters:
strWorkspaceName - the workspace name

getWorkspace

public IWorkspace getWorkspace(java.lang.String strWorkspace)
Get workspace informations

Parameters:
strWorkspace - the workspace name
Returns:
the workspace

modify

public void modify(IWorkspace workspace)
Modify workspace acces rights

Parameters:
workspace - the workspace

canAccess

public boolean canAccess(java.lang.String strWorkspace,
                         java.lang.String strAccessType,
                         java.lang.String[] userRoles)
Tests if the workspace strWorkspace can be accessed with roles in userRoles and access of type strAccessType

Parameters:
strWorkspace - the workspace name
strAccessType - the access type, it must be in IWorkspace.AVAILABLE_ACCESS
userRoles - an array of roles
Returns:
true if it is accessible, false otherwise

getAvailableAccess

public java.util.Map<java.lang.String,java.lang.Boolean> getAvailableAccess(java.lang.String strWorkspace,
                                                                            java.lang.String[] userRoles)
Get all available access, given some roles

Parameters:
strWorkspace - the workspace name
userRoles - an array of roles
Returns:
a map containing access types associated with access value


Copyright © 2007 Mairie de Paris. All Rights Reserved.