***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.information.metadata
Class FolderUtil

com.sas.services.information.metadata.FolderUtil

public class FolderUtil


Constructor Summary
FolderUtil()
           
 
Method Summary
static FolderInterface getSharedDataFolder(MetadataInterface object)
          Returns the Shared Data folder in the repository for a specified object.
static FolderInterface getSystemFolder(MetadataInterface object)
          Returns the System folder in the repository for a specified object.
static FolderInterface getTopLevelFolder(java.lang.String name, MetadataInterface object)
          Returns the Shared Data folder in the repository for a specified object.
static boolean isDIStudioUngroupedFolder(FolderInterface folder)
          Returns true if specified folder is the DI Studio Ungrouped folder.
static boolean isFolderNameUnique(FolderInterface parentFolder, java.lang.String folderName)
          Validate that the name of the folder is unique within the parent folder.
static boolean isInProjectRepository(MetadataInterface mi, FolderInterface folder)
          Is the given object or its folder in a project repository.
static boolean isSystemFolder(FolderInterface folder)
          Returns true if the specified folder is the System folder within a repository.
static FolderInterface makeDocumentsFolder(MetadataInterface object)
          Returns the Documents folder in the repository for a specified object.
static FolderInterface makeNotesFolder(MetadataInterface object)
          Returns the Notes folder in the repository for a specified object.
static FolderInterface makeOrphanedCubesFolder(MetadataInterface object)
          Returns the Orphaned Cubes folder in the repository for a specified object.
static FolderInterface makeOrphanedTablesFolder(MetadataInterface object)
          Returns the Orphaned Tables folder in the repository for a specified object.
static FolderInterface makeSharedDataFolder(MetadataInterface object)
          Returns the Shared Data folder in the repository for a specified object.
static FolderInterface makeSystemFolder(MetadataInterface object)
          Returns the System folder in the repository for a specified object.
static FolderInterface makeTopLevelFolder(java.lang.String name, MetadataInterface object, boolean systemFolder)
          Returns a top level folder of the specified name for a specified object.
static java.lang.String makeValidFolderName(FolderInterface folder, MetadataNameConstraint constraint)
          Makes a valid folder name.
static java.lang.String makeValidFolderName(java.lang.String folderName, FolderInterface parentFolder, MetadataNameConstraint constraint)
          Makes a valid folder name.
static java.lang.String makeValidObjectName(FolderInterface folder, MetadataInterface object)
          Makes a valid object name for an object given a target folder.
static java.lang.String makeValidObjectName(FolderInterface folder, MetadataInterface object, MetadataNameConstraint constraint)
          Makes a valid object name for an object given a target folder.
 

Constructor Detail

FolderUtil

public FolderUtil()
Method Detail

getSharedDataFolder

public static FolderInterface getSharedDataFolder(MetadataInterface object)
                                           throws ServiceException,
                                                  java.rmi.RemoteException
Returns the Shared Data folder in the repository for a specified object.

Parameters:
object -
Returns:
the Shared Data folder
Throws:
ServiceException
java.rmi.RemoteException

getSystemFolder

public static FolderInterface getSystemFolder(MetadataInterface object)
                                       throws ServiceException,
                                              java.rmi.RemoteException
Returns the System folder in the repository for a specified object.

Parameters:
object -
Returns:
the System folder
Throws:
ServiceException
java.rmi.RemoteException

makeSharedDataFolder

public static FolderInterface makeSharedDataFolder(MetadataInterface object)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Returns the Shared Data folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the Shared Data folder
Throws:
ServiceException
java.rmi.RemoteException

makeDocumentsFolder

public static FolderInterface makeDocumentsFolder(MetadataInterface object)
                                           throws ServiceException,
                                                  java.rmi.RemoteException
Returns the Documents folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the Documents folder
Throws:
ServiceException
java.rmi.RemoteException

makeNotesFolder

public static FolderInterface makeNotesFolder(MetadataInterface object)
                                       throws ServiceException,
                                              java.rmi.RemoteException
Returns the Notes folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the Notes folder
Throws:
ServiceException
java.rmi.RemoteException

makeSystemFolder

public static FolderInterface makeSystemFolder(MetadataInterface object)
                                        throws ServiceException,
                                               java.rmi.RemoteException
Returns the System folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the System folder
Throws:
ServiceException
java.rmi.RemoteException

getTopLevelFolder

public static FolderInterface getTopLevelFolder(java.lang.String name,
                                                MetadataInterface object)
                                         throws ServiceException,
                                                java.rmi.RemoteException
Returns the Shared Data folder in the repository for a specified object.

Parameters:
object -
Returns:
the Shared Data folder
Throws:
ServiceException
java.rmi.RemoteException

makeTopLevelFolder

public static FolderInterface makeTopLevelFolder(java.lang.String name,
                                                 MetadataInterface object,
                                                 boolean systemFolder)
                                          throws ServiceException,
                                                 java.rmi.RemoteException
Returns a top level folder of the specified name for a specified object. The specified object determines which repository contains the top level folder. The folder will be created if it does not already exist.

Parameters:
name - top level folder name
object -
systemFolder - if true a newly created top level folder will be flagged as a system folder
Returns:
the top level folder
Throws:
ServiceException
java.rmi.RemoteException

makeValidObjectName

public static java.lang.String makeValidObjectName(FolderInterface folder,
                                                   MetadataInterface object)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Makes a valid object name for an object given a target folder. The object will be given a new name with a (nnn) suffix if necessary to make the name unique in the folder. The object may already be a member of the folder.

Parameters:
folder - - target folder
object - - object to be named
Returns:
unique object name in the target folder
Throws:
ServiceException
java.rmi.RemoteException

makeValidObjectName

public static java.lang.String makeValidObjectName(FolderInterface folder,
                                                   MetadataInterface object,
                                                   MetadataNameConstraint constraint)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Makes a valid object name for an object given a target folder. The object will be given a new name with a (nnn) suffix if necessary to make the name unique in the folder. The object may already be a member of the folder.

Parameters:
folder - - target folder
object - - object to be named
constraint - - additional naming constraint
Returns:
unique object name in the target folder
Throws:
ServiceException
java.rmi.RemoteException

makeValidFolderName

public static java.lang.String makeValidFolderName(FolderInterface folder,
                                                   MetadataNameConstraint constraint)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Makes a valid folder name. The folder object will be given a new name with a (nnn) suffix if necessary to make the name unique.

Parameters:
folder - - folder object to be name validated and possibly renamed
constraint - - additional naming constraint
Returns:
unique folder name
Throws:
ServiceException
java.rmi.RemoteException

makeValidFolderName

public static java.lang.String makeValidFolderName(java.lang.String folderName,
                                                   FolderInterface parentFolder,
                                                   MetadataNameConstraint constraint)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Makes a valid folder name. The folder object will be given a new name with a (nnn) suffix if necessary to make the name unique. This method does not require an existing FolderInterface object to be passed in. Instead, this can be used prior to creating the appropriate folder.

Parameters:
folderName - the original name of the folder
parentFolder - the parent folder to belong to
constraint - additional naming constraint
Returns:
unique folder name
Throws:
ServiceException
java.rmi.RemoteException

isFolderNameUnique

public static boolean isFolderNameUnique(FolderInterface parentFolder,
                                         java.lang.String folderName)
                                  throws ServiceException,
                                         java.rmi.RemoteException
Validate that the name of the folder is unique within the parent folder.

Parameters:
parentFolder - FolderInterface object representing the parent folder.
folderName - The name of the folder to check as a unique name within the parent folder.
Returns:
True if the folder's name is unique ( we only find 1), false otherwise.
Throws:
ServiceException - If a repository error occurs.
java.rmi.RemoteException - In the event of remote object failure. FUTURE: We may want this method in the FolderInterface at some point but too late for that in 9.2

isSystemFolder

public static boolean isSystemFolder(FolderInterface folder)
                              throws ServiceException,
                                     java.rmi.RemoteException
Returns true if the specified folder is the System folder within a repository. Each repository (foundation and custom), can contain only one System folder.

Parameters:
folder -
Returns:
true if the folder is the System folder
Throws:
ServiceException
java.rmi.RemoteException

isDIStudioUngroupedFolder

public static boolean isDIStudioUngroupedFolder(FolderInterface folder)
                                         throws ServiceException,
                                                java.rmi.RemoteException
Returns true if specified folder is the DI Studio Ungrouped folder. False if the folder is in project repository.

Parameters:
folder -
Returns:
true if specified folder is the DI Studio Ungrouped folder.
Throws:
ServiceException
java.rmi.RemoteException

isInProjectRepository

public static boolean isInProjectRepository(MetadataInterface mi,
                                            FolderInterface folder)
                                     throws ServiceException,
                                            java.rmi.RemoteException
Is the given object or its folder in a project repository. This is determined from the state and repository type of the object(s) given. If the object is in a OMIRepositoryInterface and the repository type is a project, then we return true.

Parameters:
mi -
Returns:
true if object(s) in a project repository, false otherwise.
Throws:
ServiceException
java.rmi.RemoteException

makeOrphanedCubesFolder

public static FolderInterface makeOrphanedCubesFolder(MetadataInterface object)
                                               throws ServiceException,
                                                      java.rmi.RemoteException
Returns the Orphaned Cubes folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the Orphaned Cubes folder
Throws:
ServiceException
java.rmi.RemoteException

makeOrphanedTablesFolder

public static FolderInterface makeOrphanedTablesFolder(MetadataInterface object)
                                                throws ServiceException,
                                                       java.rmi.RemoteException
Returns the Orphaned Tables folder in the repository for a specified object. The folder will be created if it does not already exist.

Parameters:
object -
Returns:
the Orphaned Tables folder
Throws:
ServiceException
java.rmi.RemoteException

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.