*** This class provides Binary Compatibility only, not Source Compatibility ***
Class FolderUtil
java.lang.Object
com.sas.services.information.metadata.FolderUtil
@SASScope("ALL")
@BinaryCompatibilityOnly
public class FolderUtil
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FolderInterfacegetSharedDataFolder(MetadataInterface object) Returns the Shared Data folder in the repository for a specified object.static FolderInterfacegetSystemFolder(MetadataInterface object) Returns the System folder in the repository for a specified object.static FolderInterfacegetTopLevelFolder(String name, MetadataInterface object) Returns the Shared Data folder in the repository for a specified object.static booleanReturns true if specified folder is the DI Studio Ungrouped folder.static booleanisFolder(PublicObjectInterface object) Returns true if the public object is a folder, including whether or not it is a folder subtype.static booleanisFolder(String publicType) Returns true if the public type is used for a folder, including whether or not it is a folder subtype.static booleanisFolderNameUnique(FolderInterface parentFolder, String folderName) Validate that the name of the folder is unique within the parent folder.static booleanisInProjectRepository(MetadataInterface mi, FolderInterface folder) Is the given object or its folder in a project repository.static booleanisSystemFolder(FolderInterface folder) Returns true if the specified folder is the System folder within a repository.static FolderInterfacemakeDocumentsFolder(MetadataInterface object) Returns the Documents folder in the repository for a specified object.static FolderInterfacemakeNotesFolder(MetadataInterface object) Returns the Notes folder in the repository for a specified object.static FolderInterfaceReturns the Orphaned Cubes folder in the repository for a specified object.static FolderInterfaceReturns the Orphaned Tables folder in the repository for a specified object.static FolderInterfaceReturns the Shared Data folder in the repository for a specified object.static FolderInterfacemakeSystemFolder(MetadataInterface object) Returns the System folder in the repository for a specified object.static FolderInterfacemakeTopLevelFolder(String name, MetadataInterface object, boolean systemFolder) Returns a top level folder of the specified name for a specified object.static StringmakeValidFolderName(FolderInterface folder, MetadataNameConstraint constraint) Makes a valid folder name.static StringmakeValidFolderName(String folderName, FolderInterface parentFolder, MetadataNameConstraint constraint) Makes a valid folder name.static StringmakeValidObjectName(FolderInterface folder, MetadataInterface object) Makes a valid object name for an object given a target folder.static StringmakeValidObjectName(FolderInterface folder, MetadataInterface object, MetadataNameConstraint constraint) Makes a valid object name for an object given a target folder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
FolderUtil
public FolderUtil()
-
-
Method Details
-
getSystemFolder
public static FolderInterface getSystemFolder(MetadataInterface object) throws ServiceException, RemoteException Returns the System folder in the repository for a specified object.- Parameters:
object-- Returns:
- the System folder
- Throws:
ServiceExceptionRemoteException
-
makeDocumentsFolder
public static FolderInterface makeDocumentsFolder(MetadataInterface object) throws ServiceException, 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:
ServiceExceptionRemoteException
-
makeNotesFolder
public static FolderInterface makeNotesFolder(MetadataInterface object) throws ServiceException, 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:
ServiceExceptionRemoteException
-
makeSystemFolder
public static FolderInterface makeSystemFolder(MetadataInterface object) throws ServiceException, 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:
ServiceExceptionRemoteException
-
getTopLevelFolder
public static FolderInterface getTopLevelFolder(String name, MetadataInterface object) throws ServiceException, RemoteException Returns the Shared Data folder in the repository for a specified object.- Parameters:
object-- Returns:
- the Shared Data folder
- Throws:
ServiceExceptionRemoteException
-
makeTopLevelFolder
public static FolderInterface makeTopLevelFolder(String name, MetadataInterface object, boolean systemFolder) throws ServiceException, 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 nameobject-systemFolder- if true a newly created top level folder will be flagged as a system folder- Returns:
- the top level folder
- Throws:
ServiceExceptionRemoteException
-
makeValidObjectName
public static String makeValidObjectName(FolderInterface folder, MetadataInterface object) throws ServiceException, 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 folderobject- - object to be named- Returns:
- unique object name in the target folder
- Throws:
ServiceExceptionRemoteException
-
makeValidObjectName
public static String makeValidObjectName(FolderInterface folder, MetadataInterface object, MetadataNameConstraint constraint) throws ServiceException, 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 folderobject- - object to be namedconstraint- - additional naming constraint- Returns:
- unique object name in the target folder
- Throws:
ServiceExceptionRemoteException
-
makeValidFolderName
public static String makeValidFolderName(FolderInterface folder, MetadataNameConstraint constraint) throws ServiceException, 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 renamedconstraint- - additional naming constraint- Returns:
- unique folder name
- Throws:
ServiceExceptionRemoteException
-
makeValidFolderName
public static String makeValidFolderName(String folderName, FolderInterface parentFolder, MetadataNameConstraint constraint) throws ServiceException, 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 folderparentFolder- the parent folder to belong toconstraint- additional naming constraint- Returns:
- unique folder name
- Throws:
ServiceExceptionRemoteException
-
isFolderNameUnique
public static boolean isFolderNameUnique(FolderInterface parentFolder, String folderName) throws ServiceException, 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.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, 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:
ServiceExceptionRemoteException
-
isDIStudioUngroupedFolder
public static boolean isDIStudioUngroupedFolder(FolderInterface folder) throws ServiceException, 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:
ServiceExceptionRemoteException
-
isFolder
public static boolean isFolder(PublicObjectInterface object) throws ServiceException, RemoteException Returns true if the public object is a folder, including whether or not it is a folder subtype. To be a folder, the object's public type value must be equal to "Folder or start with "Folder."- Parameters:
object- the public object- Returns:
- true if a folder, false otherwise
- Throws:
ServiceExceptionRemoteException
-
isFolder
public static boolean isFolder(String publicType) Returns true if the public type is used for a folder, including whether or not it is a folder subtype. To be a folder, the object's public type value must be equal to "Folder or start with "Folder."- Parameters:
publicType- the object's public type value- Returns:
- true if a folder, false otherwise
-
isInProjectRepository
public static boolean isInProjectRepository(MetadataInterface mi, FolderInterface folder) throws ServiceException, 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 aOMIRepositoryInterfaceand the repository type is a project, then we return true.- Parameters:
mi-- Returns:
trueif object(s) in a project repository,falseotherwise.- Throws:
ServiceExceptionRemoteException
-
makeOrphanedCubesFolder
public static FolderInterface makeOrphanedCubesFolder(MetadataInterface object) throws ServiceException, 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:
ServiceExceptionRemoteException
-
makeOrphanedTablesFolder
public static FolderInterface makeOrphanedTablesFolder(MetadataInterface object) throws ServiceException, 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:
ServiceExceptionRemoteException