Package org.frankframework.filesystem
Interface ISupportsCustomFileAttributes<F>
- Type Parameters:
F
- The type of the file used by the implementation. See alsoIBasicFileSystem
.
- All Known Implementing Classes:
AmazonS3FileSystem
,LocalFileSystem
public interface ISupportsCustomFileAttributes<F>
An interface indicating that a filesystem supports adding custom (user-defined) file attributes. Attributes
are always set as key-value pairs. The values are always strings.
A IBasicFileSystem
that implements this interface should return any user-defined metadata attributes
in the method IBasicFileSystem.getAdditionalFileProperties(Object)
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Prefix for parameter-names, for parameters that should be set as custom metadata attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createFile
(F file, InputStream contents, Map<String, String> customFileAttributes) Creates a file with the given custom file attributes.Gets the custom attributes from theParameterValueList
.default boolean
Method to be used in configure.
-
Field Details
-
FILE_ATTRIBUTE_PARAM_PREFIX
Prefix for parameter-names, for parameters that should be set as custom metadata attributes. The prefix will not be part of the actual metadata attribute name set on the file, it is only used for filtering parameters to use for the custom metadata and stripped from the name when applying the attributes to the file.- See Also:
-
-
Method Details
-
hasCustomFileAttributes
Method to be used in configure.- Parameters:
pvl
- the ParameterValueList, may benull
.- Returns:
- true when at least one
Parameter
name starts with "FileAttribute."<F>.
-
getCustomFileAttributes
Gets the custom attributes from theParameterValueList
. The parameter value list is filtered on parameter names with the prefixFILE_ATTRIBUTE_PARAM_PREFIX
("FileAttribute."<F>).For each parameter-value, if the parameter-name starts with the prefix "FileAttribute."<F> the prefix is stripped from the name to get the attribute-name and the string-value of the parameter is used to get the attribute-value.
This is an interface default method that most implementations should not need to override.
- Parameters:
pvl
-ParameterValueList
containing inputs to apply as user-defined file metadata- Returns:
- a Map with the custom file attributes
-
createFile
void createFile(F file, InputStream contents, Map<String, String> customFileAttributes) throws FileSystemException, IOExceptionCreates a file with the given custom file attributes.- Parameters:
file
-contents
-customFileAttributes
-- Throws:
FileSystemException
IOException
-