Polishing
This commit is contained in:
parent
de6180b093
commit
c81e11d537
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
|
@ -53,7 +53,7 @@ import org.springframework.lang.Nullable;
|
|||
* @author Juergen Hoeller
|
||||
* @since 2.5
|
||||
* @see java.sql.SQLTransientException
|
||||
* @see java.sql.SQLTransientException
|
||||
* @see java.sql.SQLNonTransientException
|
||||
* @see java.sql.SQLRecoverableException
|
||||
*/
|
||||
public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLExceptionTranslator {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
|
@ -100,13 +100,12 @@ abstract class DefaultParts {
|
|||
|
||||
|
||||
/**
|
||||
* Abstract base class.
|
||||
* Abstract base class for {@link Part} implementations.
|
||||
*/
|
||||
private static abstract class AbstractPart implements Part {
|
||||
|
||||
private final HttpHeaders headers;
|
||||
|
||||
|
||||
protected AbstractPart(HttpHeaders headers) {
|
||||
Assert.notNull(headers, "HttpHeaders is required");
|
||||
this.headers = headers;
|
||||
|
@ -119,7 +118,6 @@ abstract class DefaultParts {
|
|||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HttpHeaders headers() {
|
||||
return this.headers;
|
||||
|
@ -172,7 +170,6 @@ abstract class DefaultParts {
|
|||
|
||||
protected final Content content;
|
||||
|
||||
|
||||
public DefaultPart(HttpHeaders headers, Content content) {
|
||||
super(headers);
|
||||
this.content = content;
|
||||
|
@ -198,7 +195,6 @@ abstract class DefaultParts {
|
|||
return "DefaultPart";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -213,7 +209,7 @@ abstract class DefaultParts {
|
|||
|
||||
@Override
|
||||
public String filename() {
|
||||
String filename = this.headers().getContentDisposition().getFilename();
|
||||
String filename = headers().getContentDisposition().getFilename();
|
||||
Assert.state(filename != null, "No filename found");
|
||||
return filename;
|
||||
}
|
||||
|
@ -235,7 +231,6 @@ abstract class DefaultParts {
|
|||
return "DefaultFilePart{(" + filename + ")}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,9 +244,9 @@ abstract class DefaultParts {
|
|||
Mono<Void> transferTo(Path dest);
|
||||
|
||||
Mono<Void> delete();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@code Content} implementation based on a flux of data buffers.
|
||||
*/
|
||||
|
@ -259,12 +254,10 @@ abstract class DefaultParts {
|
|||
|
||||
private final Flux<DataBuffer> content;
|
||||
|
||||
|
||||
public FluxContent(Flux<DataBuffer> content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Flux<DataBuffer> content() {
|
||||
return this.content;
|
||||
|
@ -279,7 +272,6 @@ abstract class DefaultParts {
|
|||
public Mono<Void> delete() {
|
||||
return Mono.empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -292,13 +284,11 @@ abstract class DefaultParts {
|
|||
|
||||
private final Scheduler scheduler;
|
||||
|
||||
|
||||
public FileContent(Path file, Scheduler scheduler) {
|
||||
this.file = file;
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Flux<DataBuffer> content() {
|
||||
return DataBufferUtils.readByteChannel(
|
||||
|
|
Loading…
Reference in New Issue