org.esupportail.portal.channels.CWebdav.config
Class Space

java.lang.Object
  extended byorg.esupportail.portal.channels.CWebdav.config.Space

public class Space
extends java.lang.Object

Id: Space.java,v 1.0 9 juil. 2004
Copyright (c) 2004 Esup Portail (www.esup-portail.org)
Classes: Space
Original Author: Yohan Colmant
This represents a file space on the webdav


Field Summary
private  java.util.Vector currentPath
          The currentPath used
private  java.lang.String key
          The space key
private  java.lang.String label
          The label of this space
private  java.lang.String path
          The path of this space given in the properties file
 
Constructor Summary
Space()
           
 
Method Summary
 void addPathElement(java.lang.String pathElement)
          Add a path element to the current directory
 boolean canRead(DavAccess access)
          Check if we are authorized to read this space
 void checkPath(org.jasig.portal.security.IPerson person, java.lang.String currentHierPath, java.lang.String trustedAttributeName, java.lang.String trustedAttributeValue)
          We check if the is a {...} form in the path.
 java.lang.String getKey()
           
 java.lang.String getLabel()
           
 java.lang.String getPath()
           
 java.lang.String getPathElementAt(int index)
          Return the current element path at the good index
 int getPathSize()
          Return the path size
private  void makeCurrentPath(java.lang.String currentHierPath)
          Constructs the current path using the path attribute
 void removePathElement(int index)
          Remove an element from the current path
 void setKey(java.lang.String key)
           
 void setLabel(java.lang.String label)
           
 void setPath(java.lang.String path)
           
 java.lang.String toString()
          Return a String representation of this space
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

private java.lang.String key
The space key


label

private java.lang.String label
The label of this space


path

private java.lang.String path
The path of this space given in the properties file


currentPath

private java.util.Vector currentPath
The currentPath used

Constructor Detail

Space

public Space()
Method Detail

getKey

public java.lang.String getKey()
Returns:
Returns the key.

setKey

public void setKey(java.lang.String key)
Parameters:
key - The key to set.

getLabel

public java.lang.String getLabel()
Returns:
Returns the label.

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - The label to set.

setPath

public void setPath(java.lang.String path)
Parameters:
path - The path to set.

makeCurrentPath

private void makeCurrentPath(java.lang.String currentHierPath)
Constructs the current path using the path attribute

Parameters:
currentHierPath - the hierarchy path oh the server. for example, if the server's url is http://URL:PORT/slide, the currentHierPath is "/slide"

getPath

public java.lang.String getPath()
Returns:
Returns the path.

checkPath

public void checkPath(org.jasig.portal.security.IPerson person,
                      java.lang.String currentHierPath,
                      java.lang.String trustedAttributeName,
                      java.lang.String trustedAttributeValue)
We check if the is a {...} form in the path. If yes, we replace by the real value

Parameters:
person - the connected person
currentHierPath - the hierarchy path oh the server. for example, if the server's url is http://URL:PORT/slide, the currentHierPath is "/slide"
trustedAttributeName - if there is a trusted attribute, this is the name of this one
trustedAttributeValue - if there is a trusted attribute, this is the value of this one

addPathElement

public void addPathElement(java.lang.String pathElement)
Add a path element to the current directory

Parameters:
pathElement -

removePathElement

public void removePathElement(int index)
Remove an element from the current path

Parameters:
index -

getPathSize

public int getPathSize()
Return the path size

Returns:
the size

getPathElementAt

public java.lang.String getPathElementAt(int index)
Return the current element path at the good index

Parameters:
index - the selected index
Returns:
a string

canRead

public boolean canRead(DavAccess access)
                throws ApplicationException
Check if we are authorized to read this space

Parameters:
access - the object used to access the webdav
Returns:
true if authorized else false
Throws:
ApplicationException

toString

public java.lang.String toString()
Return a String representation of this space