Class FilesAndFoldersHandler<FILESYSTEM,FOLDER,FILE>

java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.FilesAndFoldersHandler<FILESYSTEM,FOLDER,FILE>
Type Parameters:
FILESYSTEM - the class representing a file system
FOLDER - the class representing a folder in the file system
FILE - the class representing a file in the file system

public class FilesAndFoldersHandler<FILESYSTEM,FOLDER,FILE> extends Object
FilesAndFoldersHandler provides the support for managing catalog entries about files and folders.
  • Constructor Details

    • FilesAndFoldersHandler

      public FilesAndFoldersHandler(OpenMetadataAPIGenericConverter<FILESYSTEM> fileSystemConverter, Class<FILESYSTEM> fileSystemBeanClass, OpenMetadataAPIGenericConverter<FOLDER> folderConverter, Class<FOLDER> folderBeanClass, OpenMetadataAPIGenericConverter<FILE> fileConverter, Class<FILE> fileBeanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
      Construct the handler information needed to interact with the repository services
      Parameters:
      fileSystemConverter - specific converter for the FILESYSTEM bean class
      fileSystemBeanClass - name of bean class that is represented by the generic class FILESYSTEM
      folderConverter - specific converter for the FOLDER bean class
      folderBeanClass - name of bean class that is represented by the generic class FOLDER
      fileConverter - specific converter for the FILE bean class
      fileBeanClass - name of bean class that is represented by the generic class FILE
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      repositoryHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      localServerUserId - userId for this server
      securityVerifier - open metadata security services verifier
      supportedZones - list of zones that the access service is allowed to serve Asset instances from.
      defaultZones - list of zones that the access service should set in all new Asset instances.
      publishZones - list of zones that the access service sets up in published Asset instances.
      auditLog - destination for audit log events.
  • Method Details

    • createFolderStructureInCatalog

      public List<String> createFolderStructureInCatalog(String userId, String externalSourceGUID, String externalSourceName, String connectToGUID, String fileSystemName, List<String> folderNames, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Creates a new folder asset for each element in the pathName that is linked from the anchor entity. For example, a pathName of "one/two/three" creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three".
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      connectToGUID - root object to connect the folder to
      fileSystemName - name of the root of the file system (can be null)
      folderNames - list of the folder names
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of GUIDs from the top level to the leaf of the supplied pathname
      Throws:
      InvalidParameterException - one of the parameters is null or invalid
      PropertyServerException - problem accessing property server
      UserNotAuthorizedException - security access problem
    • addFileAssetPath

      public void addFileAssetPath(String userId, String externalSourceGUID, String externalSourceName, String fileAssetGUID, String fileAssetParameterName, String fileAssetTypeName, String pathName, String pathNameParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Takes a new file asset and links it to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyFile.txt" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a file asset called "one/two/three/MyFile.txt". Care is taken to handle the case where the file system and file folders exist in the catalog but are not visible through the user's zones.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      fileAssetGUID - unique identifier of file asset
      fileAssetParameterName - parameter providing the fileAssetGUID
      fileAssetTypeName - name of the type of file or folder
      pathName - pathname of the file
      pathNameParameterName - parameter providing the pathName
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is null or invalid
      PropertyServerException - problem accessing property server
      UserNotAuthorizedException - security access problem