public class FilesAndFoldersHandler extends Object
| Constructor and Description |
|---|
FilesAndFoldersHandler(String serviceName,
String serverName,
InvalidParameterHandler invalidParameterHandler,
RepositoryHandler repositoryHandler,
OMRSRepositoryHelper repositoryHelper,
List<String> supportedZones,
AssetHandler assetHandler,
SchemaTypeHandler schemaTypeHandler,
SoftwareServerCapabilityHandler softwareServerCapabilityHandler)
Construct the handler information needed to interact with the repository services
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
addAvroFileToCatalog(String userId,
String displayName,
String description,
String fullPath,
String methodName)
Add a simple asset description linked to a connection object for an Avro file.
|
List<String> |
addCSVFileToCatalog(String userId,
String displayName,
String description,
String fullPath,
List<String> columnHeaders,
Character delimiterCharacter,
Character quoteCharacter,
String methodName)
Add a simple asset description linked to a connection object for a CSV file.
|
List<String> |
addDataFileAssetToCatalog(String userId,
String displayName,
String description,
String pathName,
String methodName)
Creates a new file asset and links it to the folder structure implied in the path name.
|
List<String> |
addDataFolderAssetToCatalog(String userId,
String displayName,
String description,
String pathName,
String methodName)
Creates a new folder asset that is identified as a data asset.
|
List<String> |
addFileToCatalog(String userId,
String fullPath,
String displayName,
String description,
Map<String,String> additionalProperties,
String connectorClassName,
String typeName,
Map<String,Object> extendedProperties,
String methodName)
Add a simple asset description linked to a connection object for a file.
|
void |
attachDataFileAssetToFolder(String userId,
String folderGUID,
String fileGUID,
String methodName)
Link an existing file asset to a folder.
|
void |
attachFolderToFileSystem(String userId,
String fileSystemGUID,
String folderGUID,
String methodName)
Links a folder to a file system.
|
List<String> |
createFolderStructureInCatalog(String userId,
String pathName,
String methodName)
Creates a new folder asset for each element in the pathName.
|
List<String> |
createFolderStructureInCatalog(String userId,
String anchorGUID,
String pathName,
String methodName)
Creates a new folder asset for each element in the pathName that is linked from the anchor entity.
|
void |
detachDataFileAssetFromFolder(String userId,
String folderGUID,
String fileGUID,
String methodName)
Remove a link between a file asset and a folder.
|
void |
detachFolderFromFileSystem(String userId,
String fileSystemGUID,
String folderGUID,
String methodName)
Removed the link between a folder and a file system.
|
List<Asset> |
findDataFileByName(String userId,
String name,
String methodName)
Retrieve data files by the supplied wildcard name.
|
List<Asset> |
findDataFileByPathName(String userId,
String pathName,
String methodName)
Retrieve a data file by its fully qualified path name.
|
List<Asset> |
findFolderByName(String userId,
String name,
String methodName)
Retrieve folder by the supplied wildcard name.
|
List<Asset> |
findFolderByPathName(String userId,
String pathName,
String methodName)
Retrieve a folder by its fully qualified path name.
|
Connection |
getAvroFileConnection(String fileName)
This method creates a connection for an Avro File.
|
Connection |
getCSVFileConnection(String fileName,
List<String> columnHeaders,
Character delimiterCharacter,
Character quoteCharacter)
This method creates a connection for a CSV File.
|
Asset |
getDataFileByGUID(String userId,
String dataFileGUID,
String methodName)
Retrieve a Folder asset by its unique identifier (GUID).
|
Asset |
getDataFileByPathName(String userId,
String pathName,
String methodName)
Retrieve a data file by its fully qualified path name.
|
Connection |
getDataFileConnection(String fileName)
This method creates a connection for a File.
|
Connection |
getDataFolderConnection(String folderName)
This method creates a connection for a data folder.
|
Asset |
getFolderByGUID(String userId,
String folderGUID,
String methodName)
Retrieve a Folder asset by its unique identifier (GUID).
|
Asset |
getFolderByPathName(String userId,
String pathName,
String methodName)
Retrieve a folder by its fully qualified path name.
|
List<String> |
getFolderFiles(String userId,
String folderGUID,
int startingFrom,
int maxPageSize,
String methodName)
Get the files inside a folder - both those that are nested and those that are linked.
|
List<String> |
getNestedFolders(String userId,
String anchorGUID,
int startingFrom,
int maxPageSize,
String methodName)
Return the list of folders nested inside a folder.
|
void |
moveDataFileInCatalog(String userId,
String folderGUID,
String fileGUID,
String methodName)
Move a file from its current parent folder to a new parent folder - this changes the file's qualified name
but not its unique identifier (guid).
|
void |
moveDataFolderInCatalog(String userId,
String folderGUID,
String dataFolderGUID,
String methodName)
Move a file from its current parent folder to a new parent folder - this changes the file's qualified name
but not its unique identifier (guid).
|
public FilesAndFoldersHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, List<String> supportedZones, AssetHandler assetHandler, SchemaTypeHandler schemaTypeHandler, SoftwareServerCapabilityHandler softwareServerCapabilityHandler)
serviceName - name of this serviceserverName - name of the local serversupportedZones - list of supported zonesassetHandler - handler for assetsschemaTypeHandler - handler for schema elementssoftwareServerCapabilityHandler - handler for file systemsinvalidParameterHandler - handler for managing parameter errorsrepositoryHandler - manages calls to the repository servicesrepositoryHelper - provides utilities for manipulating the repository services objectspublic List<String> createFolderStructureInCatalog(String userId, String anchorGUID, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling useranchorGUID - root object to connect the folder topathName - pathname of the folder (or folders)methodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> createFolderStructureInCatalog(String userId, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userpathName - pathname of the folder (or folders)methodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void attachFolderToFileSystem(String userId, String fileSystemGUID, String folderGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfileSystemGUID - unique identifier of the file system in the catalogfolderGUID - unique identifier of the folder in the catalogmethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void detachFolderFromFileSystem(String userId, String fileSystemGUID, String folderGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfileSystemGUID - unique identifier of the file system in the catalogfolderGUID - unique identifier of the folder in the catalogmethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void attachDataFileAssetToFolder(String userId, String folderGUID, String fileGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - unique identifier of the folderfileGUID - unique identifier of the filemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void detachDataFileAssetFromFolder(String userId, String folderGUID, String fileGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - unique identifier of the folderfileGUID - unique identifier of the filemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void moveDataFileInCatalog(String userId, String folderGUID, String fileGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - new parent folderfileGUID - unique identifier of the file to movemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic void moveDataFolderInCatalog(String userId, String folderGUID, String dataFolderGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - new parent folderdataFolderGUID - unique identifier of the data folder to movemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> addDataFileAssetToCatalog(String userId, String displayName, String description, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userdisplayName - display name for the folder in the catalogdescription - description of the folder in the catalogpathName - pathname of the filemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> addDataFolderAssetToCatalog(String userId, String displayName, String description, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userdisplayName - display name for the folder in the catalogdescription - description of the folder in the catalogpathName - pathname of the filemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> addFileToCatalog(String userId, String fullPath, String displayName, String description, Map<String,String> additionalProperties, String connectorClassName, String typeName, Map<String,Object> extendedProperties, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling user (assumed to be the owner)fullPath - unique path and file name for filedisplayName - short display name for file (defaults to the file name without the path)description - description of the fileadditionalProperties - additional properties from the userconnectorClassName - qualified class name for the connector provider for this type of filetypeName - name of the type (default is File)extendedProperties - any additional properties for the file typemethodName - calling methodInvalidParameterException - full path or userId is nullPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> addAvroFileToCatalog(String userId, String displayName, String description, String fullPath, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling user (assumed to be the owner)displayName - display name for the file in the catalogdescription - description of the file in the catalogfullPath - full path of the file - used to access the file through the connectormethodName - calling methodInvalidParameterException - full path or userId is nullPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> addCSVFileToCatalog(String userId, String displayName, String description, String fullPath, List<String> columnHeaders, Character delimiterCharacter, Character quoteCharacter, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling user (assumed to be the owner)displayName - display name for the file in the catalogdescription - description of the file in the catalogfullPath - full path of the file - used to access the file through the connectorcolumnHeaders - does the first line of the file contain the column names. If not pass the list of column headers.delimiterCharacter - what is the delimiter character - null for default of commaquoteCharacter - what is the character to group a field that contains delimiter charactersmethodName - calling methodInvalidParameterException - full path or userId is nullPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic Connection getDataFileConnection(String fileName)
fileName - name of the file to connect topublic Connection getCSVFileConnection(String fileName, List<String> columnHeaders, Character delimiterCharacter, Character quoteCharacter)
fileName - name of the file to connect tocolumnHeaders - boolean parameter defining if the column headers are included in the filedelimiterCharacter - character used between the columnsquoteCharacter - character used to group text that includes the delimiter characterpublic Connection getAvroFileConnection(String fileName)
fileName - name of the file to connect topublic Connection getDataFolderConnection(String folderName)
folderName - name of the file to connect topublic Asset getFolderByGUID(String userId, String folderGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - unique identifier used to locate the foldermethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic Asset getFolderByPathName(String userId, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userpathName - path namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<Asset> findFolderByPathName(String userId, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userpathName - path namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<Asset> findFolderByName(String userId, String name, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling username - wildcard namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> getNestedFolders(String userId, String anchorGUID, int startingFrom, int maxPageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling useranchorGUID - unique identifier of the anchor folder or file systemstartingFrom - starting point in the listmaxPageSize - maximum number of resultsmethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<String> getFolderFiles(String userId, String folderGUID, int startingFrom, int maxPageSize, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userfolderGUID - unique identifier of the anchor folderstartingFrom - starting point in the listmaxPageSize - maximum number of resultsmethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic Asset getDataFileByGUID(String userId, String dataFileGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userdataFileGUID - unique identifier used to locate the foldermethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic Asset getDataFileByPathName(String userId, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userpathName - path namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<Asset> findDataFileByPathName(String userId, String pathName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling userpathName - path namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problempublic List<Asset> findDataFileByName(String userId, String name, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
userId - calling username - wildcard namemethodName - calling methodInvalidParameterException - one of the parameters is null or invalidPropertyServerException - problem accessing property serverUserNotAuthorizedException - security access problemCopyright © 2018–2020 ODPi. All rights reserved.