mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Add file name to DirectAccessUrl (#2081)
* Add file name to DirectAccessUrl This will cause it to be returned in the response * Only set file name if direct url is enabled * Fix bad mock and protect null pointer * Update data-model/src/main/java/org/alfresco/service/cmr/repository/DirectAccessUrl.java null safe comparison Co-authored-by: Piotr Żurek <Piotr.Zurek@hyland.com> --------- Co-authored-by: Piotr Żurek <Piotr.Zurek@hyland.com>
This commit is contained in:
@@ -39,6 +39,7 @@ public class DirectAccessUrl implements Serializable
|
||||
private String contentUrl;
|
||||
private Date expiryTime;
|
||||
private boolean attachment;
|
||||
private String fileName;
|
||||
|
||||
public String getContentUrl()
|
||||
{
|
||||
@@ -70,18 +71,28 @@ public class DirectAccessUrl implements Serializable
|
||||
this.attachment = attachment;
|
||||
}
|
||||
|
||||
public String getFileName()
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName)
|
||||
{
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj) return true;
|
||||
if (obj == null || getClass() != obj.getClass()) return false;
|
||||
|
||||
DirectAccessUrl that = (DirectAccessUrl) obj;
|
||||
return attachment == that.attachment && Objects.equals(contentUrl,
|
||||
return Objects.equals(fileName, that.fileName) && attachment == that.attachment && Objects.equals(contentUrl,
|
||||
that.contentUrl) && Objects.equals(expiryTime, that.expiryTime);
|
||||
}
|
||||
|
||||
@Override public int hashCode()
|
||||
{
|
||||
return Objects.hash(contentUrl, expiryTime, attachment);
|
||||
return Objects.hash(contentUrl, expiryTime, attachment, fileName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user