Add Nullability support into Java DSL
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2023 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.
|
||||
@@ -28,6 +28,7 @@ import org.springframework.integration.file.remote.session.SessionFactory;
|
||||
import org.springframework.integration.file.support.FileExistsMode;
|
||||
import org.springframework.integration.ftp.gateway.FtpOutboundGateway;
|
||||
import org.springframework.integration.ftp.session.FtpRemoteFileTemplate;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* The factory for FTP components.
|
||||
@@ -56,7 +57,7 @@ public final class Ftp {
|
||||
* @return the spec.
|
||||
*/
|
||||
public static FtpInboundChannelAdapterSpec inboundAdapter(SessionFactory<FTPFile> sessionFactory,
|
||||
Comparator<File> receptionOrderComparator) {
|
||||
@Nullable Comparator<File> receptionOrderComparator) {
|
||||
|
||||
return new FtpInboundChannelAdapterSpec(sessionFactory, receptionOrderComparator);
|
||||
}
|
||||
@@ -82,7 +83,7 @@ public final class Ftp {
|
||||
*/
|
||||
public static FtpStreamingInboundChannelAdapterSpec inboundStreamingAdapter(
|
||||
RemoteFileTemplate<FTPFile> remoteFileTemplate,
|
||||
Comparator<FTPFile> receptionOrderComparator) {
|
||||
@Nullable Comparator<FTPFile> receptionOrderComparator) {
|
||||
|
||||
return new FtpStreamingInboundChannelAdapterSpec(remoteFileTemplate, receptionOrderComparator);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2023 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.
|
||||
@@ -31,6 +31,7 @@ import org.springframework.integration.ftp.filters.FtpSimplePatternFileListFilte
|
||||
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer;
|
||||
import org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizingMessageSource;
|
||||
import org.springframework.integration.metadata.SimpleMetadataStore;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A {@link RemoteFileInboundChannelAdapterSpec} for an {@link FtpInboundFileSynchronizingMessageSource}.
|
||||
@@ -43,7 +44,9 @@ public class FtpInboundChannelAdapterSpec
|
||||
extends RemoteFileInboundChannelAdapterSpec<FTPFile, FtpInboundChannelAdapterSpec,
|
||||
FtpInboundFileSynchronizingMessageSource> {
|
||||
|
||||
protected FtpInboundChannelAdapterSpec(SessionFactory<FTPFile> sessionFactory, Comparator<File> comparator) {
|
||||
protected FtpInboundChannelAdapterSpec(SessionFactory<FTPFile> sessionFactory,
|
||||
@Nullable Comparator<File> comparator) {
|
||||
|
||||
super(new FtpInboundFileSynchronizer(sessionFactory));
|
||||
this.target = new FtpInboundFileSynchronizingMessageSource(this.synchronizer, comparator);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2023 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.
|
||||
@@ -29,6 +29,7 @@ import org.springframework.integration.ftp.filters.FtpRegexPatternFileListFilter
|
||||
import org.springframework.integration.ftp.filters.FtpSimplePatternFileListFilter;
|
||||
import org.springframework.integration.ftp.inbound.FtpStreamingMessageSource;
|
||||
import org.springframework.integration.metadata.SimpleMetadataStore;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A {@link RemoteFileStreamingInboundChannelAdapterSpec} for a {@link FtpStreamingMessageSource}.
|
||||
@@ -43,7 +44,7 @@ public class FtpStreamingInboundChannelAdapterSpec
|
||||
FtpStreamingMessageSource> {
|
||||
|
||||
protected FtpStreamingInboundChannelAdapterSpec(RemoteFileTemplate<FTPFile> remoteFileTemplate,
|
||||
Comparator<FTPFile> comparator) {
|
||||
@Nullable Comparator<FTPFile> comparator) {
|
||||
|
||||
this.target = new FtpStreamingMessageSource(remoteFileTemplate, comparator);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/**
|
||||
* Provides FTP Components for the Java DSL.
|
||||
*/
|
||||
@org.springframework.lang.NonNullApi
|
||||
@org.springframework.lang.NonNullFields
|
||||
package org.springframework.integration.ftp.dsl;
|
||||
|
||||
Reference in New Issue
Block a user