Checkstyle changes

* Upgrade to Checkstyle 9.0
* apply some JavaDocs rules
* Fix JavaDocs rules violations
* Some other minor clean up in the affected classes
This commit is contained in:
Artem Bilan
2021-09-28 11:55:25 -04:00
parent d2e23c5f03
commit fe57fd281c
217 changed files with 742 additions and 581 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -44,12 +44,12 @@ public class DefaultDirectoryScanner implements DirectoryScanner {
private volatile FileLocker locker;
/**
* Initializes {@link DefaultDirectoryScanner#filter} with a default list of
* Initialize {@link DefaultDirectoryScanner#filter} with a default list of
* {@link FileListFilter}s using a {@link CompositeFileListFilter}:
* <ul>
* <li>{@link IgnoreHiddenFileListFilter}</li>
* <li>{@link AcceptOnceFileListFilter}</li>
* </ul>
* </ul>.
*/
public DefaultDirectoryScanner() {
final List<FileListFilter<File>> defaultFilters = new ArrayList<>(2);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -43,22 +43,22 @@ public abstract class FileHeaders {
public static final String SET_MODIFIED = PREFIX + "setModified";
/**
* Record is a file marker (START/END)
* Record is a file marker (START/END).
*/
public static final String MARKER = PREFIX + "marker";
/**
* The line count for END marker message after splitting
* The line count for END marker message after splitting.
*/
public static final String LINE_COUNT = PREFIX + "lineCount";
/**
* A remote file information representation
* A remote file information representation.
*/
public static final String REMOTE_FILE_INFO = PREFIX + "remoteFileInfo";
/**
* A remote host/port the file has been polled from
* A remote host/port the file has been polled from.
*/
public static final String REMOTE_HOST_PORT = PREFIX + "remoteHostPort";

View File

@@ -173,7 +173,7 @@ public class FileReadingMessageSource extends AbstractMessageSource<File> implem
/**
* Optionally specify a custom scanner, for example the
* {@link WatchServiceDirectoryScanner}
* {@link WatchServiceDirectoryScanner}.
* @param scanner scanner implementation
*/
public void setScanner(DirectoryScanner scanner) {

View File

@@ -323,8 +323,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
* {@code flushInterval} and {@code flushInterval * 1.33} with an average of
* {@code flushInterval * 1.167}.
* @param flushInterval the interval.
* @see #setFlushWhenIdle(boolean)
* @since 4.3
* @see #setFlushWhenIdle(boolean)
*/
public void setFlushInterval(long flushInterval) {
this.flushInterval = flushInterval;
@@ -336,9 +336,9 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
* write to a previously flushed or new file.
* @param flushWhenIdle false to flush on the interval after the first write
* to a closed file.
* @since 4.3.7
* @see #setFlushInterval(long)
* @see #setBufferSize(int)
* @since 4.3.7
*/
public void setFlushWhenIdle(boolean flushWhenIdle) {
this.flushWhenIdle = flushWhenIdle;
@@ -372,8 +372,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
/**
* String setter for Spring XML convenience.
* @param chmod permissions as an octal string e.g "600";
* @see #setChmod(int)
* @since 5.0
* @see #setChmod(int)
*/
public void setChmodOctal(String chmod) {
Assert.notNull(chmod, "'chmod' cannot be null");
@@ -1144,8 +1144,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
* When using {@link FileExistsMode#APPEND_NO_FLUSH}
* an implementation of this interface is called for each file that has pending data
* to flush when a trigger message is received.
* @see FileWritingMessageHandler#trigger(Message)
* @since 4.3
* @see FileWritingMessageHandler#trigger(Message)
*
*/
@FunctionalInterface

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -91,7 +91,7 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
/**
* If false, thread for capturing stderr will not be started
* and stderr output will be ignored
* and stderr output will be ignored.
* @param enableStatusReader true or false
* @since 4.3.6
*/

View File

@@ -81,8 +81,8 @@ public class FileInboundChannelAdapterSpec
* {@link RecursiveDirectoryScanner} or stay with a default one.
* @param recursive to set or not a {@link RecursiveDirectoryScanner}.
* @return the spec.
* @see org.springframework.integration.file.RecursiveDirectoryScanner
* @since 5.5
* @see org.springframework.integration.file.RecursiveDirectoryScanner
*/
public FileInboundChannelAdapterSpec recursive(boolean recursive) {
if (recursive) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2021 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.
@@ -250,8 +250,8 @@ public class FileWritingMessageHandlerSpec
* owner read/write. Only applies to file systems that support posix
* file permissions.
* @param chmod the permissions.
* @throws IllegalArgumentException if the value is higher than 0777.
* @return the spec.
* @throws IllegalArgumentException if the value is higher than 0777.
* @see FileWritingMessageHandler#setChmod(int)
*/
public FileWritingMessageHandlerSpec chmod(int chmod) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -24,6 +24,8 @@ import java.util.List;
* evaluated against each File in isolation. If the entire List of files is
* required for evaluation, implement the FileListFilter interface directly.
*
* @param <F> the target protocol file type.
*
* @author Mark Fisher
* @author Iwein Fuld
* @author Gary Russell

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2021 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.
@@ -34,7 +34,10 @@ import java.util.stream.Collectors;
* Since they look at multiple files, they cannot be used for late filtering in the
* streaming message source.
*
* @param <F> the target protocol file type.
*
* @author Gary Russell
*
* @since 5.0
*
*/
@@ -87,7 +90,7 @@ public abstract class AbstractMarkerFilePresentFileListFilter<F> implements File
* function returns "foo.txt.complete", this filter will only pass "foo.txt" if
* "foo.txt.complete" is present. The function returns the name of the marker file to
* match, or {@code null} for never match. Due to type erasure, we cannot provide a
* constructor taking {@code Map<Filter, suffix}. For convenience, you can use
* constructor taking {@code Map<Filter, Function>}. For convenience, you can use
* {@link #defaultFileNameFunction(String)} to use the default function used by the
* {@link #AbstractMarkerFilePresentFileListFilter(FileListFilter, String)}
* constructor.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
@@ -22,7 +22,7 @@ import org.springframework.util.Assert;
/**
* Filters a listing of files by qualifying their 'name'
* against a regular expression (an instance of {@link java.util.regex.Pattern})
* against a regular expression (an instance of {@link Pattern}).
*
* @param <F> the type of file entry
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -23,11 +23,15 @@ import org.springframework.util.AntPathMatcher;
* but more readable than regular expressions. This filter only filters on the name of the
* file, the rest of the path is ignored.
*
* @param <F> the file type.
*
* @author Iwein Fuld
* @author Mark Fisher
*
* @since 2.0
*
* @see org.springframework.util.AntPathMatcher
* @see org.springframework.integration.file.filters.AbstractRegexPatternFileListFilter
* @since 2.0
*/
public abstract class AbstractSimplePatternFileListFilter<F> extends AbstractDirectoryAwareFileListFilter<F> {
@@ -42,7 +46,7 @@ public abstract class AbstractSimplePatternFileListFilter<F> extends AbstractDir
/**
* Accepts the given file if its name matches the pattern.
* Accept the given file if its name matches the pattern.
*/
@Override
public final boolean accept(F file) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -21,10 +21,10 @@ package org.springframework.integration.file.filters;
* Simple implementation of {@link FileListFilter} that always returns true.
* Suitable as a default.
*
* @param <F> The type that will be filtered.
*
* @author Iwein Fuld
* @author Josh Long
*
* @param <F> The type that will be filtered.
*/
public class AcceptAllFileListFilter<F> extends AbstractFileListFilter<F> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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,8 @@ import org.springframework.lang.Nullable;
* <p>
* This implementation is thread safe.
*
* @param <F> the file type.
*
* @author Iwein Fuld
* @author Josh Long
* @author Gary Russell

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2021 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.
@@ -24,6 +24,8 @@ import org.springframework.lang.Nullable;
* The {@link FileListFilter} modification which can accept a {@link Consumer}
* which can be called when the filter discards the file.
*
* @param <F> The type that will be filtered.
*
* @author Artem Bilan
* @author Gary Russell
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2021 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,8 @@ import org.springframework.util.Assert;
/**
* A SpEL expression based {@link AbstractFileListFilter} implementation.
*
* @param <F> The type that will be filtered.
*
* @author Artem Bilan
* @author Gary Russell
*

View File

@@ -22,6 +22,8 @@ import java.util.List;
* Strategy interface for filtering a group of files. This is a generic filter intended
* to work with either local files or references to remote files.
*
* @param <F> The type that will be filtered.
*
* @author Iwein Fuld
* @author Josh Long
* @author Gary Russell

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2021 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.
@@ -19,14 +19,16 @@ package org.springframework.integration.file.filters;
/**
* A {@link FileListFilter} that can be reset by removing a specific file from its
* state.
* @author Gary Russell
* @since 4.1.7
* @param <F> The type that will be filtered.
*
* @author Gary Russell
*
* @since 4.1.7
*/
public interface ResettableFileListFilter<F> extends FileListFilter<F> {
/**
* Remove the specified file from the filter so it will pass on the next attempt.
* Remove the specified file from the filter, so it will pass on the next attempt.
* @param f the element to remove.
* @return true if the file was removed as a result of this call.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2021 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.
@@ -23,9 +23,11 @@ import java.util.List;
* A {@link FileListFilter} that allows the caller to reverse (roll back) state
* changes.
*
* @author Gary Russell
* @since 4.0.4
* @param <F> The type that will be filtered.
*
* @author Gary Russell
*
* @since 4.0.4
*/
public interface ReversibleFileListFilter<F> extends FileListFilter<F> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -24,7 +24,10 @@ import org.springframework.integration.json.SimpleJsonSerializer;
* Abstract implementation of {@link FileInfo}; provides a setter
* for the remote directory and a generic toString implementation.
*
* @param <F> The target protocol file type.
*
* @author Gary Russell
*
* @since 2.1
*/
public abstract class AbstractFileInfo<F> implements FileInfo<F>, Comparable<FileInfo<F>> {
@@ -43,14 +46,6 @@ public abstract class AbstractFileInfo<F> implements FileInfo<F>, Comparable<Fil
return this.remoteDirectory;
}
@Override
public String toString() {
return "FileInfo [isDirectory=" + isDirectory() + ", isLink=" + isLink()
+ ", Size=" + getSize() + ", ModifiedTime="
+ new Date(getModified()) + ", Filename=" + getFilename()
+ ", RemoteDirectory=" + getRemoteDirectory() + ", Permissions=" + getPermissions() + "]";
}
@Override
public int compareTo(FileInfo<F> o) {
return this.getFilename().compareTo(o.getFilename());
@@ -60,4 +55,12 @@ public abstract class AbstractFileInfo<F> implements FileInfo<F>, Comparable<Fil
return SimpleJsonSerializer.toJson(this, "fileInfo");
}
@Override
public String toString() {
return "FileInfo [isDirectory=" + isDirectory() + ", isLink=" + isLink()
+ ", Size=" + getSize() + ", ModifiedTime="
+ new Date(getModified()) + ", Filename=" + getFilename()
+ ", RemoteDirectory=" + getRemoteDirectory() + ", Permissions=" + getPermissions() + "]";
}
}

View File

@@ -49,6 +49,8 @@ import org.springframework.util.ObjectUtils;
* A message source that produces a message with an {@link InputStream} payload
* referencing a remote file.
*
* @param <F> The target protocol file type.
*
* @author Gary Russell
* @author Artem Bilan
* @author Lukas Gemela
@@ -110,7 +112,7 @@ public abstract class AbstractRemoteFileStreamingMessageSource<F>
}
/**
* Set the remote file separator; default '/'
* Set the remote file separator; default '/'.
* @param remoteFileSeparator the remote file separator.
*/
public void setRemoteFileSeparator(String remoteFileSeparator) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2021 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.
@@ -20,12 +20,12 @@ package org.springframework.integration.file.remote;
* {@code RemoteFileTemplate} callback with the underlying client instance providing
* access to lower level methods.
*
* @author Gary Russell
*
* @param <C> The type of the underlying client object.
* @param <T> The return type of the callback method.
* @since 4.1
*
* @author Gary Russell
*
* @since 4.1
*/
@FunctionalInterface
public interface ClientCallback<C, T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2021 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.
@@ -21,12 +21,12 @@ package org.springframework.integration.file.remote;
* {@code RemoteFileTemplate} callback with the underlying client instance providing
* access to lower level methods where no result is returned.
*
* @param <C> The type of the underlying client object.
*
* @author Gary Russell
* @author Artem Bilan
*
* @param <C> The type of the underlying client object.
* @since 4.1
*
*/
@FunctionalInterface
public interface ClientCallbackWithoutResult<C> extends ClientCallback<C, Object> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -19,7 +19,10 @@ package org.springframework.integration.file.remote;
/**
* Represents a remote file info - an abstraction over the underlying implementation.
*
* @param <F> The target protocol file type.
*
* @author Gary Russell
*
* @since 2.1
*/
public interface FileInfo<F> {
@@ -62,7 +65,8 @@ public interface FileInfo<F> {
/**
* @return the actual implementation from the underlying
* library, more sophisticated access is needed.
* library, more sophisticated access is needed.
*/
F getFileInfo();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2021 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.
@@ -25,7 +25,11 @@ import org.springframework.messaging.Message;
* Callback invoked by {@code RemoteFileOperations.executeForMessage()}
* - allows multiple operations on a session.
*
* @param <F> the target protocol file type.
* @param <T> the expected execution result.
*
* @author Artem Bilan
*
* @since 4.2
*/
@FunctionalInterface

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 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.
@@ -23,9 +23,11 @@ import org.springframework.messaging.Message;
/**
* Strategy for performing operations on remote files.
*
* @author Gary Russell
* @since 3.0
* @param <F> the file type.
*
* @author Gary Russell
*
* @since 3.0
*/
public interface RemoteFileOperations<F> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2020 the original author or authors.
* Copyright 2013-2021 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.
@@ -51,6 +51,8 @@ import org.springframework.util.StringUtils;
/**
* A general abstraction for dealing with remote files.
*
* @param <F> the file type.
*
* @author Iwein Fuld
* @author Mark Fisher
* @author Josh Long
@@ -65,7 +67,7 @@ import org.springframework.util.StringUtils;
*/
public class RemoteFileTemplate<F> implements RemoteFileOperations<F>, InitializingBean, BeanFactoryAware {
private final Log logger = LogFactory.getLog(this.getClass());
protected final Log logger = LogFactory.getLog(getClass()); // NOSONAR - final
/**
* The {@link SessionFactory} for acquiring remote file Sessions.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 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.
@@ -24,8 +24,11 @@ import org.springframework.integration.file.remote.session.Session;
* Simple convenience implementation of {@link SessionCallback} for cases where
* no result is returned.
*
* @param <F> the target system file type.
*
* @author Gary Russell
* @author Artem Bilan
*
* @since 3.0
*
*/

View File

@@ -67,6 +67,8 @@ import org.springframework.util.StringUtils;
/**
* Base class for Outbound Gateways that perform remote file operations.
*
* @param <F> the file type.
*
* @author Gary Russell
* @author Artem Bilan
*
@@ -481,8 +483,8 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
/**
* String setter for Spring XML convenience.
* @param chmod permissions as an octal string e.g "600";
* @see #setChmod(int)
* @since 4.3
* @see #setChmod(int)
*/
public void setChmodOctal(String chmod) {
Assert.notNull(chmod, "'chmod' cannot be null");
@@ -1429,7 +1431,7 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
EXCEPTION_WHEN_EMPTY("-x"),
/**
* (-R) Recursive (ls, mget)
* (-R) Recursive (ls, mget).
*/
RECURSIVE("-R"),

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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,8 @@ import org.springframework.util.Assert;
/**
* A {@link org.springframework.messaging.MessageHandler} implementation that transfers files to a remote server.
*
* @param <F> the file type.
*
* @author Iwein Fuld
* @author Mark Fisher
* @author Josh Long
@@ -171,8 +173,8 @@ public class FileTransferringMessageHandler<F> extends AbstractMessageHandler {
/**
* String setter for Spring XML convenience.
* @param chmod permissions as an octal string e.g "600";
* @see #setChmod(int)
* @since 4.3
* @see #setChmod(int)
*/
public void setChmodOctal(String chmod) {
Assert.notNull(chmod, "'chmod' cannot be null");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -32,6 +32,8 @@ import org.springframework.util.Assert;
* requiring reconnection each time the Session is retrieved from the factory.
* This implementation wraps and delegates to a target SessionFactory instance.
*
* @param <F> the target system file type.
*
* @author Josh Long
* @author Oleg Zhurakousky
* @author Mark Fisher
@@ -68,10 +70,10 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
* no sessions are available in the cache, and the size limit has been reached,
* calling threads will block until a session is available.
* <p> Do not cache a {@link DelegatingSessionFactory}, cache each delegate therein instead.
* @see #setSessionWaitTimeout(long)
* @see #setPoolSize(int)
* @param sessionFactory The underlying session factory.
* @param sessionCacheSize The maximum cache size.
* @see #setSessionWaitTimeout(long)
* @see #setPoolSize(int)
*/
public CachingSessionFactory(SessionFactory<F> sessionFactory, int sessionCacheSize) {
Assert.isTrue(!(sessionFactory instanceof DelegatingSessionFactory),

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 the original author or authors.
* Copyright 2015-2021 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.
@@ -25,6 +25,8 @@ import org.springframework.lang.Nullable;
* The default implementation of {@link SessionFactoryLocator} using a simple map lookup
* and an optional default to fall back on.
*
* @param <F> the target system file type.
*
* @author Gary Russell
* @author Andrey Kezhevatov
* @author Artem Bilan

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2021 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.
@@ -25,6 +25,8 @@ import org.springframework.util.Assert;
* {@link SessionFactory} that delegates to a {@link SessionFactory} retrieved from a
* {@link SessionFactoryLocator}.
*
* @param <F> the target system file type.
*
* @author Gary Russell
* @since 4.2
*
@@ -33,7 +35,7 @@ public class DelegatingSessionFactory<F> implements SessionFactory<F> {
private final SessionFactoryLocator<F> factoryLocator;
private final ThreadLocal<Object> threadKey = new ThreadLocal<Object>();
private final ThreadLocal<Object> threadKey = new ThreadLocal<>();
/**
* Construct an instance with a {@link DefaultSessionFactoryLocator} using the

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -24,12 +24,16 @@ import java.io.OutputStream;
/**
* Common abstraction for a Session with a remote File system.
*
* @param <F> the target system file type.
*
* @author Josh Long
* @author Mario Gray
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Gary Russell
* @author Alen Turkovic
* @author Artem Bilan
*
* @since 2.0
*/
public interface Session<F> extends Closeable {
@@ -128,8 +132,8 @@ public interface Session<F> extends Closeable {
/**
* Mark this session as dirty, indicating that it should not be reused and any
* delegated sessions should be taken care of before closing.
* @see CachingSessionFactory.CachedSession#close()
* @since 5.1.2
* @see CachingSessionFactory.CachedSession#close()
*/
default void dirty() {
// NOOP

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -19,7 +19,10 @@ package org.springframework.integration.file.remote.session;
/**
* Factory for acquiring {@link Session} instances.
*
* @param <F> the target system file type.
*
* @author Mark Fisher
*
* @since 2.0
*/
@FunctionalInterface

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2021 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.
@@ -20,9 +20,11 @@ package org.springframework.integration.file.remote.session;
*
* A factory returning a {@link SessionFactory} based on some key.
*
* @author Gary Russell
* @since 4.2
* @param <F> the target system file type.
*
* @author Gary Russell
*
* @since 4.2
*/
@FunctionalInterface
public interface SessionFactoryLocator<F> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2021 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.
@@ -21,7 +21,10 @@ import org.springframework.integration.support.MapBuilder;
/**
* A {@link MapBuilder} to producer a map that maps objects to {@link SessionFactory}s.
*
* @param <T> the target system file type.
*
* @author Gary Russell
*
* @since 5.0.7
*
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 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.
@@ -58,6 +58,8 @@ import org.springframework.util.Assert;
* handle the work of actually connecting to the remote file system and
* delivering new {@link File}s.
*
* @param <F> the target system file type.
*
* @author Josh Long
* @author Oleg Zhurakousky
* @author Gary Russell
@@ -287,7 +289,7 @@ public abstract class AbstractInboundFileSynchronizingMessageSource<F>
/**
* The {@link FileReadingMessageSource} extension to increase visibility
* for the {@link FileReadingMessageSource#doReceive()}
* for the {@link FileReadingMessageSource#doReceive()}.
*/
private static final class LocalFileReadingMessageSource extends FileReadingMessageSource {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -23,19 +23,20 @@ import java.io.File;
*
* @author Mark Fisher
* @author Gary Russell
*
* @since 2.0
*/
@FunctionalInterface
public interface InboundFileSynchronizer {
/**
* Synchronize all available files to the local directory;
* Synchronize all available files to the local directory.
* @param localDirectory the directory.
*/
void synchronizeToLocalDirectory(File localDirectory);
/**
* Synchronize up to maxFetchSize files to the local directory;
* Synchronize up to maxFetchSize files to the local directory.
* @param localDirectory the directory.
* @param maxFetchSize the maximum files to fetch.
*/

View File

@@ -60,7 +60,7 @@ public class OSDelegatingFileTailingMessageProducer extends FileTailingMessagePr
/**
* If false, thread for capturing stderr will not be started
* and stderr output will be ignored
* and stderr output will be ignored.
* @param enableStatusReader true or false
* @since 4.3.6
*/

View File

@@ -37,14 +37,16 @@ import org.springframework.util.Assert;
/**
* Base class for transformers that convert a File payload.
*
* @param <T> the expected payload type.
*
* @author Mark Fisher
* @author Artem Bilan
*/
public abstract class AbstractFilePayloadTransformer<T> implements Transformer, BeanFactoryAware {
private final Log logger = LogFactory.getLog(this.getClass());
protected final Log logger = LogFactory.getLog(getClass()); // NOSONAR - final
private volatile boolean deleteFiles;
private boolean deleteFiles;
private volatile MessageBuilderFactory messageBuilderFactory = new DefaultMessageBuilderFactory();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 the original author or authors.
* Copyright 2015-2021 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.
@@ -311,7 +311,7 @@ public class FileSplitterTests {
splitter.setOutputChannel(outputChannel);
splitter.handleMessage(new GenericMessage<>(file));
verifier.verify(Duration.ofSeconds(1));
verifier.verify(Duration.ofSeconds(10));
}
@Test