Class MetaData
java.lang.Object
io.github.qubitpi.athena.metadata.MetaData
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
Returns the name of the file associated with this metadata instance.@NotNull FileType
Returns the extension info of the file associated with this metadata instance.static @NotNull MetaData
of
(@NotNull graphql.ExecutionResult executionResult) Given a GraphQL query result, constructs an athena representation of a file metadata contained in that result.static @NotNull MetaData
Given a set of key-value pairs, constructs an athena representation of a file metadata whose states are based on the specified key-value pairs.static @NotNull MetaData
of
(@NotNull org.glassfish.jersey.media.multipart.FormDataContentDisposition uploadedMetaData) Given a form-data content disposition header from a file upload request, constructs an athena representation of the uploaded file metadata.
-
Field Details
-
FILE_NAME
Attribute name for filename in metadata object.- See Also:
-
FILE_TYPE
Attribute name forFileType
in metadata object.- See Also:
-
-
Method Details
-
of
@NotNull public static @NotNull MetaData of(@NotNull @NotNull org.glassfish.jersey.media.multipart.FormDataContentDisposition uploadedMetaData) Given a form-data content disposition header from a file upload request, constructs an athena representation of the uploaded file metadata.- Parameters:
uploadedMetaData
- The file metadata object from HTTP request- Returns:
- a new instance
- Throws:
NullPointerException
- ifuploadedMetaData
isnull
-
of
@NotNull public static @NotNull MetaData of(@NotNull @NotNull graphql.ExecutionResult executionResult) Given a GraphQL query result, constructs an athena representation of a file metadata contained in that result.- Parameters:
executionResult
- The native GraphQL result- Returns:
- a new instance
- Throws:
NullPointerException
- ifexecutionResult
isnull
-
of
Given a set of key-value pairs, constructs an athena representation of a file metadata whose states are based on the specified key-value pairs.The set of pairs must be a map with the following two keys, each of which has non-null values:
- Parameters:
fieldMap
- The provided key-value pairs- Returns:
- a new instance
- Throws:
IllegalArgumentException
- if the key-value pairs are missing one ofFILE_NAME
orFILE_TYPE
keys
-
getFileName
Returns the name of the file associated with this metadata instance.- Returns:
- the file name, including its extension
-
getFileType
Returns the extension info of the file associated with this metadata instance.- Returns:
- file type information
-