Skip to content

Commit 4f4bdfc

Browse files
committed
Fix deprecations from SF; prepare for release
1 parent 6e68bd8 commit 4f4bdfc

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

spring-integration-core/src/main/java/org/springframework/integration/support/converter/AllowListDeserializingConverter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
2626

2727
import org.springframework.beans.DirectFieldAccessor;
2828
import org.springframework.core.ConfigurableObjectInputStream;
29-
import org.springframework.core.NestedIOException;
3029
import org.springframework.core.convert.converter.Converter;
3130
import org.springframework.core.serializer.DefaultDeserializer;
3231
import org.springframework.core.serializer.Deserializer;
@@ -169,7 +168,7 @@ protected Class<?> resolveClass(ObjectStreamClass classDesc)
169168
return objectInputStream.readObject();
170169
}
171170
catch (ClassNotFoundException ex) {
172-
throw new NestedIOException("Failed to deserialize object type", ex);
171+
throw new IOException("Failed to deserialize object type", ex);
173172
}
174173
}
175174

spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
2828
import org.apache.commons.logging.Log;
2929
import org.apache.commons.logging.LogFactory;
3030

31-
import org.springframework.core.NestedIOException;
3231
import org.springframework.integration.file.remote.session.Session;
3332
import org.springframework.util.Assert;
3433
import org.springframework.util.FileCopyUtils;
@@ -100,7 +99,7 @@ public boolean remove(String path) throws IOException {
10099
return true;
101100
}
102101
catch (SftpException e) {
103-
throw new NestedIOException("Failed to remove file.", e);
102+
throw new IOException("Failed to remove file.", e);
104103
}
105104
}
106105

@@ -120,7 +119,7 @@ public LsEntry[] list(String path) throws IOException {
120119
}
121120
}
122121
catch (SftpException e) {
123-
throw new NestedIOException("Failed to list files", e);
122+
throw new IOException("Failed to list files", e);
124123
}
125124
return new LsEntry[0];
126125
}
@@ -148,7 +147,7 @@ public void read(String source, OutputStream os) throws IOException {
148147
FileCopyUtils.copy(is, os);
149148
}
150149
catch (SftpException e) {
151-
throw new NestedIOException("failed to read file " + source, e);
150+
throw new IOException("failed to read file " + source, e);
152151
}
153152
}
154153

@@ -158,7 +157,7 @@ public InputStream readRaw(String source) throws IOException {
158157
return this.channel.get(source);
159158
}
160159
catch (SftpException e) {
161-
throw new NestedIOException("failed to read file " + source, e);
160+
throw new IOException("failed to read file " + source, e);
162161
}
163162
}
164163

@@ -174,7 +173,7 @@ public void write(InputStream inputStream, String destination) throws IOExceptio
174173
this.channel.put(inputStream, destination);
175174
}
176175
catch (SftpException e) {
177-
throw new NestedIOException("failed to write file", e);
176+
throw new IOException("failed to write file", e);
178177
}
179178
}
180179

@@ -185,7 +184,7 @@ public void append(InputStream inputStream, String destination) throws IOExcepti
185184
this.channel.put(inputStream, destination, ChannelSftp.APPEND);
186185
}
187186
catch (SftpException e) {
188-
throw new NestedIOException("failed to write file", e);
187+
throw new IOException("failed to write file", e);
189188
}
190189
}
191190

@@ -227,7 +226,7 @@ public void rename(String pathFrom, String pathTo) throws IOException {
227226
}
228227
}
229228
catch (IOException ioex) {
230-
NestedIOException exception = new NestedIOException("Failed to delete file " + pathTo, sftpex);
229+
IOException exception = new IOException("Failed to delete file " + pathTo, sftpex);
231230
exception.addSuppressed(ioex);
232231
throw exception; // NOSONAR - added to suppressed exceptions
233232
}
@@ -236,8 +235,8 @@ public void rename(String pathFrom, String pathTo) throws IOException {
236235
this.channel.rename(pathFrom, pathTo);
237236
}
238237
catch (SftpException sftpex2) {
239-
NestedIOException exception =
240-
new NestedIOException("failed to rename from " + pathFrom + " to " + pathTo, sftpex);
238+
IOException exception =
239+
new IOException("failed to rename from " + pathFrom + " to " + pathTo, sftpex);
241240
exception.addSuppressed(sftpex2);
242241
throw exception; // NOSONAR - added to suppressed exceptions
243242
}
@@ -254,7 +253,7 @@ public boolean mkdir(String remoteDirectory) throws IOException {
254253
}
255254
catch (SftpException ex) {
256255
if (ex.id != ChannelSftp.SSH_FX_FAILURE || !exists(remoteDirectory)) {
257-
throw new NestedIOException("failed to create remote directory '" + remoteDirectory + "'.", ex);
256+
throw new IOException("failed to create remote directory '" + remoteDirectory + "'.", ex);
258257
}
259258
}
260259
return true;
@@ -266,7 +265,7 @@ public boolean rmdir(String remoteDirectory) throws IOException {
266265
this.channel.rmdir(remoteDirectory);
267266
}
268267
catch (SftpException e) {
269-
throw new NestedIOException("failed to remove remote directory '" + remoteDirectory + "'.", e);
268+
throw new IOException("failed to remove remote directory '" + remoteDirectory + "'.", e);
270269
}
271270
return true;
272271
}

spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ClientWebSocketContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2020 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -272,7 +272,7 @@ protected void closeConnection() throws Exception { // NOSONAR
272272
}
273273

274274
@Override
275-
protected boolean isConnected() {
275+
public boolean isConnected() {
276276
return ((ClientWebSocketContainer.this.clientSession != null)
277277
&& (ClientWebSocketContainer.this.clientSession.isOpen()));
278278
}

spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private void configureSockJsOptionsIfAny(WebSocketHandlerRegistration registrati
195195
.acceptIfNotNull(this.sockJsServiceOptions.messageCodec,
196196
sockJsServiceRegistration::setMessageCodec)
197197
.acceptIfNotNull(this.sockJsServiceOptions.suppressCors,
198-
sockJsServiceRegistration::setSupressCors);
198+
sockJsServiceRegistration::setSuppressCors);
199199
}
200200
}
201201

0 commit comments

Comments
 (0)