Package nl.knaw.dans.lib.dataverse
Class FileApi
java.lang.Object
nl.knaw.dans.lib.dataverse.FileApi
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected PathgetQueryParamsFromMetadataKeys(Map<String, String> metadataKeys) replaceFile(Path dataFile, String fileMeta) replaceFile(Path dataFile, FileMeta fileMeta) protected PathtoString()updateMetadata(String fileMeta) updateMetadata(FileMeta fileMeta) protected PathversionedSubPath(String endPoint, String version)
-
Field Details
-
persistendId
- See Also:
-
publish
- See Also:
-
invocationIdHeaderName
- See Also:
-
targetBase
-
id
-
isPersistentId
protected final boolean isPersistentId -
extraHeaders
-
MDKEY_PARAM_NAME_PREFIX
- See Also:
-
httpClientWrapper
protected final nl.knaw.dans.lib.dataverse.HttpClientWrapper httpClientWrapper
-
-
Method Details
-
replaceFile
public DataverseHttpResponse<FileList> replaceFile(Path dataFile, FileMeta fileMeta) throws IOException, DataverseException - Parameters:
dataFile- the data filefileMeta- json containing file metadata- Returns:
- a file list
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
replaceFile
public DataverseHttpResponse<FileList> replaceFile(Path dataFile, String fileMeta) throws IOException, DataverseException - Parameters:
dataFile- the data filefileMeta- json containing file metadata- Returns:
- a file list
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
updateMetadata
public DataverseHttpResponse<String> updateMetadata(FileMeta fileMeta) throws IOException, DataverseException - Parameters:
fileMeta- the file metadata- Returns:
- hash map
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
updateMetadata
public DataverseHttpResponse<String> updateMetadata(String fileMeta) throws IOException, DataverseException - Parameters:
fileMeta- the file metadata- Returns:
- hash map
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
toString
-
params
-
subPath
-
versionedSubPath
-
buildPath
-
getQueryParamsFromMetadataKeys
-