Class FileClassifier
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.fileclassifier.FileClassifier
Manages different types of classifications for files. It retrieves file reference data from
the open metadata store and maintains a cache.
-
Constructor Summary
ConstructorDescriptionFileClassifier
(OpenMetadataStore openMetadataStore) Use the valid values to classify files on request. -
Method Summary
Modifier and TypeMethodDescriptionclassifyFile
(File file) Classify the properties of the file represented by the Java File object.classifyFile
(String pathName) Classify the properties of the file represented by the path name.getFileExtension
(String fileName) Retrieves the extension from a file name.
-
Constructor Details
-
FileClassifier
Use the valid values to classify files on request.- Parameters:
openMetadataStore
- open metadata where the valid values are stored.
-
-
Method Details
-
classifyFile
public FileClassification classifyFile(String pathName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, IOException Classify the properties of the file represented by the path name.- Parameters:
pathName
- name of the file- Returns:
- file classification
- Throws:
InvalidParameterException
- invalid parameterPropertyServerException
- problem connecting to the open metadata repositoriesUserNotAuthorizedException
- insufficient accessIOException
- unable to access the attributes of the file
-
classifyFile
public FileClassification classifyFile(File file) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, IOException Classify the properties of the file represented by the Java File object.- Parameters:
file
- details of the file- Returns:
- file classification
- Throws:
InvalidParameterException
- invalid parameterPropertyServerException
- problem connecting to the open metadata repositoriesUserNotAuthorizedException
- insufficient accessIOException
-
getFileExtension
Retrieves the extension from a file name. For example, if the file name is "three.txt", the method returns "txt". If the path name has multiple extensions, such as "my-jar.jar.gz", the final extension is returned (ie "gz"). Null is returned if there is no file extension in the file name.- Parameters:
fileName
- short name- Returns:
- file extension
-