com.ptc.windchill.uwgm.common.folder
Class VirtualPathParser

java.lang.Object
  extended bycom.ptc.windchill.uwgm.common.folder.VirtualPathParser

public class VirtualPathParser
extends Object

Virtual Folder path parser


Field Summary
private  WTContainer container
           
private  Object folderObject
           
private  FolderHelper.FolderType folderType
           
private  Locale locale
           
private static Log log
          logging
private  WTPrincipal principal
           
 
Constructor Summary
VirtualPathParser(String virtualPath, WTPrincipal principal, Locale locale)
          constructor
VirtualPathParser(String virtualPath, WTPrincipal principal, Locale locale, WTContainer container)
          constructor
 
Method Summary
 Object getFolderObject()
          returns folder object folder object is either FakeFolder, WTContainer, EPMWorkspace or Folder and needs to be casted according to getFolderObjectType().
 FolderHelper.FolderType getFolderObjectType()
          returns folder object type as FolderHelper.FolderType or null if folder is not found
private  String makeFullPath(String cabinetPath, List pathElements)
          makes folder full path from Cabinet folderPath and subfolders path elements
private  void parseVirtualPath(String virtualPath)
          internal method to parse virtual path and set folderType and folderObject
private  void setFolderObject(WTPrincipal principal, WTContainer container, List pathElements)
          sets FolderObject and FolderType base on container and list of subfolder names
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

principal

private final WTPrincipal principal

locale

private final Locale locale

container

private final WTContainer container

folderType

private FolderHelper.FolderType folderType

folderObject

private Object folderObject

log

private static Log log
logging

Constructor Detail

VirtualPathParser

public VirtualPathParser(String virtualPath,
                         WTPrincipal principal,
                         Locale locale)
                  throws WTException
constructor

Parameters:
virtualPath - String
principal - WTPrincipal
locale - Locale
Throws:
WTException

VirtualPathParser

public VirtualPathParser(String virtualPath,
                         WTPrincipal principal,
                         Locale locale,
                         WTContainer container)
                  throws WTException
constructor

Parameters:
virtualPath - String
principal - WTPrincipal
locale - Locale
container - WTContainer
Throws:
WTException
Method Detail

getFolderObjectType

public FolderHelper.FolderType getFolderObjectType()
returns folder object type as FolderHelper.FolderType or null if folder is not found

Returns:
FolderType

getFolderObject

public Object getFolderObject()
returns folder object folder object is either FakeFolder, WTContainer, EPMWorkspace or Folder and needs to be casted according to getFolderObjectType().

Returns:
Object or null if no object was found

parseVirtualPath

private void parseVirtualPath(String virtualPath)
                       throws WTException
internal method to parse virtual path and set folderType and folderObject

Parameters:
virtualPath - String
Throws:
WTException

setFolderObject

private void setFolderObject(WTPrincipal principal,
                             WTContainer container,
                             List pathElements)
                      throws WTException
sets FolderObject and FolderType base on container and list of subfolder names

Parameters:
principal - WTPrincipal
container - WTContainer
pathElements - List
Throws:
WTException

makeFullPath

private String makeFullPath(String cabinetPath,
                            List pathElements)
makes folder full path from Cabinet folderPath and subfolders path elements

Parameters:
cabinetPath - String or null
pathElements - List
Returns:
String