@@ -128,12 +128,11 @@ protected void visitStart(PartVisitor visitor, byte[] boundary) throws IOExcepti
128
128
}
129
129
130
130
protected void visitDispositionHeader (PartVisitor visitor ) throws IOException {
131
-
131
+ visitor .withBytes (CRLF_BYTES );
132
+ visitor .withBytes (CONTENT_DISPOSITION_BYTES );
133
+ visitor .withBytes (getDispositionType () != null ? getDispositionType ().getBytes (StandardCharsets .US_ASCII )
134
+ : FORM_DATA_DISPOSITION_TYPE_BYTES );
132
135
if (getName () != null ) {
133
- visitor .withBytes (CRLF_BYTES );
134
- visitor .withBytes (CONTENT_DISPOSITION_BYTES );
135
- visitor .withBytes (getDispositionType () != null ? getDispositionType ().getBytes (StandardCharsets .US_ASCII )
136
- : FORM_DATA_DISPOSITION_TYPE_BYTES );
137
136
visitor .withBytes (NAME_BYTES );
138
137
visitor .withBytes (QUOTE_BYTES );
139
138
visitor .withBytes (getName ().getBytes (StandardCharsets .US_ASCII ));
@@ -239,14 +238,15 @@ public long length(byte[] boundary) {
239
238
}
240
239
}
241
240
242
- /**
243
- * Return a string representation of this object.
244
- *
245
- * @return A string representation of this object.
246
- * @see java.lang.Object#toString()
247
- */
248
241
public String toString () {
249
- return this .getName ();
242
+ return new StringBuilder ()//
243
+ .append ("name=" ).append (getName ())//
244
+ .append (" contentType=" ).append (getContentType ())//
245
+ .append (" charset=" ).append (getCharSet ())//
246
+ .append (" tranferEncoding=" ).append (getTransferEncoding ())//
247
+ .append (" contentId=" ).append (getContentId ())//
248
+ .append (" dispositionType=" ).append (getDispositionType ())//
249
+ .toString ();
250
250
}
251
251
252
252
public abstract long write (WritableByteChannel target , byte [] boundary ) throws IOException ;
0 commit comments