Class FileMeta
java.lang.Object
nl.knaw.dans.lib.dataverse.model.file.FileMeta
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanintgetLabel()Dataverse uses "restrict" in the Add File To Dataset API, but returns "restricted" in the response message; "restricted" is ignored by Add File To Dataset.See comments in thegetRestrict()method docs.intinthashCode()voidsetCategories(List<String> categories) voidsetDataFile(DataFile dataFile) voidsetDatasetVersionId(int datasetVersionId) voidsetDescription(String description) voidsetDirectoryLabel(String directoryLabel) voidsetForceReplace(Boolean forceReplace) voidvoidsetRestrict(Boolean restrict) See comments in thegetRestrict()method docs.voidsetRestricted(Boolean restricted) See comments in thegetRestrict()method docs.voidsetVersion(int version) toFileMetaUpdate(boolean sendRestrict) Convert this object to a FileMetaUpdate object, which can be used in the {DatasetApi.updateFileMetadatas(List)method.toString()
-
Constructor Details
-
FileMeta
public FileMeta()
-
-
Method Details
-
toPrestagedFile
-
toFileMetaUpdate
-
toFileMetaUpdate
Convert this object to a FileMetaUpdate object, which can be used in the {DatasetApi.updateFileMetadatas(List)method. Note, that the 'restrict' property is only included in the FileMetaUpdate object if the 'sendRestrict' parameter is true and the 'restricted' property is not null. You should only send the 'restrict' property if you want to change the restricted status of the file. Dataverse will return an error if you set 'restrict' to the same value as the current restricted status of the file.- Parameters:
sendRestrict- whether to include the 'restrict' property in the FileMetaUpdate object- Returns:
- the FileMetaUpdate object
-
getRestrict
Dataverse uses "restrict" in the Add File To Dataset API, but returns "restricted" in the response message; "restricted" is ignored by Add File To Dataset. This library works around the confusion by supporting both the "restrict" and "restricted" property, storing them in the same private field.- Returns:
- whether the file is or should be restricted
- See Also:
-
setRestrict
See comments in thegetRestrict()method docs.- Parameters:
restrict- whether to restrict the file or not
-
getRestricted
See comments in thegetRestrict()method docs. *- Returns:
- whether the file is or should be restricted
- See Also:
-
setRestricted
See comments in thegetRestrict()method docs.- Parameters:
restricted- whether to restrict the file or not
-
getLabel
-
getDescription
-
getDirectoryLabel
-
getVersion
public int getVersion() -
getDatasetVersionId
public int getDatasetVersionId() -
getCategories
-
getDataFile
-
getForceReplace
-
setLabel
-
setDescription
-
setDirectoryLabel
-
setVersion
public void setVersion(int version) -
setDatasetVersionId
public void setDatasetVersionId(int datasetVersionId) -
setCategories
-
setDataFile
-
setForceReplace
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-