Polishing

This commit is contained in:
Juergen Hoeller
2018-06-28 18:13:40 +02:00
parent 03beee7b68
commit 9a20ec9284
6 changed files with 32 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -177,9 +177,9 @@ public class ContentDisposition {
result = 31 * result + ObjectUtils.nullSafeHashCode(this.filename);
result = 31 * result + ObjectUtils.nullSafeHashCode(this.charset);
result = 31 * result + ObjectUtils.nullSafeHashCode(this.size);
result = 31 * result + (creationDate != null ? creationDate.hashCode() : 0);
result = 31 * result + (modificationDate != null ? modificationDate.hashCode() : 0);
result = 31 * result + (readDate != null ? readDate.hashCode() : 0);
result = 31 * result + (this.creationDate != null ? this.creationDate.hashCode() : 0);
result = 31 * result + (this.modificationDate != null ? this.modificationDate.hashCode() : 0);
result = 31 * result + (this.readDate != null ? this.readDate.hashCode() : 0);
return result;
}
@@ -198,7 +198,7 @@ public class ContentDisposition {
sb.append(this.name).append('\"');
}
if (this.filename != null) {
if(this.charset == null || StandardCharsets.US_ASCII.equals(this.charset)) {
if (this.charset == null || StandardCharsets.US_ASCII.equals(this.charset)) {
sb.append("; filename=\"");
sb.append(this.filename).append('\"');
}
@@ -441,12 +441,12 @@ public class ContentDisposition {
public interface Builder {
/**
* Set the value of the {@literal name} parameter
* Set the value of the {@literal name} parameter.
*/
Builder name(String name);
/**
* Set the value of the {@literal filename} parameter
* Set the value of the {@literal filename} parameter.
*/
Builder filename(String filename);
@@ -463,7 +463,7 @@ public class ContentDisposition {
Builder filename(String filename, Charset charset);
/**
* Set the value of the {@literal size} parameter
* Set the value of the {@literal size} parameter.
*/
Builder size(Long size);
@@ -483,7 +483,7 @@ public class ContentDisposition {
Builder readDate(ZonedDateTime readDate);
/**
* Build the content disposition
* Build the content disposition.
*/
ContentDisposition build();
}