Add EmptyLineSeparator Checkstyle rule
* Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -169,7 +169,6 @@ public class FileReadingMessageSource extends AbstractMessageSource<File> implem
|
||||
this.toBeReceived = new PriorityBlockingQueue<>(DEFAULT_INTERNAL_QUEUE_CAPACITY, receptionOrderComparator);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specify the input directory.
|
||||
* @param directory to monitor
|
||||
@@ -418,7 +417,6 @@ public class FileReadingMessageSource extends AbstractMessageSource<File> implem
|
||||
this.toBeReceived.offer(failedMessage.getPayload());
|
||||
}
|
||||
|
||||
|
||||
public enum WatchEventType {
|
||||
|
||||
CREATE(StandardWatchEventKinds.ENTRY_CREATE),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -224,7 +224,6 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
this.temporaryFileSuffixSet = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Will set the {@link FileExistsMode} that specifies what will happen in
|
||||
* case the destination exists. For example {@link FileExistsMode#APPEND}
|
||||
@@ -772,7 +771,6 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
boolean append = FileExistsMode.APPEND.equals(this.fileExistsMode)
|
||||
|| FileExistsMode.APPEND_NO_FLUSH.equals(this.fileExistsMode);
|
||||
|
||||
|
||||
try {
|
||||
this.lockRegistry.executeLocked(fileToWriteTo.getAbsolutePath(),
|
||||
() -> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -55,7 +55,6 @@ public class HeadDirectoryScanner extends DefaultDirectoryScanner {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final class HeadFilter implements FileListFilter<File> {
|
||||
|
||||
private final int maxNumberOfFiles;
|
||||
@@ -68,6 +67,7 @@ public class HeadDirectoryScanner extends DefaultDirectoryScanner {
|
||||
public List<File> filterFiles(File[] files) {
|
||||
return Arrays.asList(files).subList(0, Math.min(files.length, this.maxNumberOfFiles));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2019 the original author or authors.
|
||||
* Copyright 2015-2024 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,6 @@ import org.springframework.integration.config.xml.AbstractConsumerEndpointParser
|
||||
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
||||
import org.springframework.integration.file.splitter.FileSplitter;
|
||||
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 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.
|
||||
@@ -97,7 +97,6 @@ public class FileInboundChannelAdapterSpec
|
||||
return _this();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specify a custom scanner.
|
||||
* @param scanner the scanner.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 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.
|
||||
@@ -63,7 +63,6 @@ public class TailAdapterSpec extends MessageProducerSpec<TailAdapterSpec, FileTa
|
||||
return _this();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This field control the stderr events.
|
||||
* @param enableStatusReader boolean to enable or disable events from stderr.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2023 the original author or authors.
|
||||
* Copyright 2023-2024 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.
|
||||
@@ -86,7 +86,7 @@ public abstract class AbstractLastModifiedFileListFilter<F> implements DiscardAw
|
||||
public List<F> filterFiles(F[] files) {
|
||||
List<F> list = new ArrayList<>();
|
||||
Instant now = Instant.now();
|
||||
for (F file: files) {
|
||||
for (F file : files) {
|
||||
if (fileIsAged(file, now)) {
|
||||
list.add(file);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -36,7 +36,6 @@ public abstract class AbstractRegexPatternFileListFilter<F> extends AbstractDire
|
||||
|
||||
private Pattern pattern;
|
||||
|
||||
|
||||
public AbstractRegexPatternFileListFilter(String pattern) {
|
||||
this(Pattern.compile(pattern));
|
||||
}
|
||||
@@ -46,7 +45,6 @@ public abstract class AbstractRegexPatternFileListFilter<F> extends AbstractDire
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
|
||||
public void setPattern(String pattern) {
|
||||
Assert.notNull(pattern, "'pattern' must not be null!");
|
||||
setPattern(Pattern.compile(pattern));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -39,12 +39,10 @@ public abstract class AbstractSimplePatternFileListFilter<F> extends AbstractDir
|
||||
|
||||
private final String path;
|
||||
|
||||
|
||||
public AbstractSimplePatternFileListFilter(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accept the given file if its name matches the pattern.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.integration.file.filters;
|
||||
|
||||
|
||||
/**
|
||||
* Simple implementation of {@link FileListFilter} that always returns true.
|
||||
* Suitable as a default.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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,7 +51,6 @@ public class AcceptOnceFileListFilter<F> extends AbstractFileListFilter<F> imple
|
||||
|
||||
private final Lock monitor = new ReentrantLock();
|
||||
|
||||
|
||||
/**
|
||||
* Creates an AcceptOnceFileListFilter that is based on a bounded queue. If the queue overflows,
|
||||
* files that fall out will be passed through this filter again if passed to the
|
||||
@@ -69,7 +68,6 @@ public class AcceptOnceFileListFilter<F> extends AbstractFileListFilter<F> imple
|
||||
this.seen = null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(F file) {
|
||||
this.monitor.lock();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2021 the original author or authors.
|
||||
* Copyright 2013-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.integration.file.filters;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.springframework.integration.metadata.ConcurrentMetadataStore;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -35,7 +35,6 @@ public class RegexPatternFileListFilter extends AbstractRegexPatternFileListFilt
|
||||
super(pattern);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getFilename(File file) {
|
||||
return (file != null) ? file.getName() : null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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,13 +32,11 @@ public class SimplePatternFileListFilter extends AbstractSimplePatternFileListFi
|
||||
super(path);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getFilename(File file) {
|
||||
return file.getName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean isDirectory(File file) {
|
||||
return file.isDirectory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -41,7 +41,6 @@ final class FileChannelCache {
|
||||
|
||||
private static ConcurrentMap<File, FileChannel> channelCache = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
private FileChannelCache() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 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.
|
||||
@@ -175,7 +175,6 @@ public abstract class AbstractRemoteFileStreamingMessageSource<F>
|
||||
protected void doInit() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
this.running.set(true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
* Copyright 2014-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2021 the original author or authors.
|
||||
* Copyright 2013-2024 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.
|
||||
@@ -247,7 +247,6 @@ public class RemoteFileTemplate<F> implements RemoteFileOperations<F>, Initializ
|
||||
this.temporaryFileSuffix = temporaryFileSuffix;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
@@ -416,7 +415,6 @@ public class RemoteFileTemplate<F> implements RemoteFileOperations<F>, Initializ
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public F[] list(String path) {
|
||||
return execute(session -> session.list(path));
|
||||
|
||||
@@ -112,7 +112,6 @@ public class StandardRotationPolicy implements RotationPolicy {
|
||||
return this.current;
|
||||
}
|
||||
|
||||
|
||||
protected DelegatingSessionFactory<?> getFactory() {
|
||||
return this.factory;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -1309,8 +1309,8 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
*/
|
||||
protected String getFullFileName(String remoteDirectory, F remoteFile) {
|
||||
return remoteDirectory != null
|
||||
? remoteDirectory + getFilename(remoteFile)
|
||||
: getFilename(remoteFile);
|
||||
? remoteDirectory + getFilename(remoteFile)
|
||||
: getFilename(remoteFile);
|
||||
}
|
||||
|
||||
private String getRemoteDirectory(String remoteFilePath, String remoteFilename) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -64,7 +64,6 @@ public class FileTransferringMessageHandler<F> extends AbstractMessageHandler {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A {@code boolean} flag to indicate automatically create the directory or not.
|
||||
* @param autoCreateDirectory true to automatically create the directory.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -85,6 +85,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
"'sessionFactory' cannot be a 'DelegatingSessionFactory'; cache each delegate instead");
|
||||
this.sessionFactory = sessionFactory;
|
||||
this.pool = new SimplePool<>(sessionCacheSize, new SimplePool.PoolItemCallback<Session<F>>() {
|
||||
|
||||
@Override
|
||||
public Session<F> createForPool() {
|
||||
return CachingSessionFactory.this.sessionFactory.getSession();
|
||||
@@ -103,7 +104,6 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
this.isSharedSessionCapable = sessionFactory instanceof SharedSessionCapable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the limit of how long to wait for a session to become available.
|
||||
* @param sessionWaitTimeout the session wait timeout.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
* Copyright 2013-2024 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.integration.file.remote.session;
|
||||
|
||||
|
||||
/**
|
||||
* A {@link SessionFactory} that implements this interface is capable of supporting a shared session.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -219,7 +219,6 @@ public abstract class AbstractInboundFileSynchronizer<F>
|
||||
doSetRemoteDirectoryExpression(EXPRESSION_PARSER.parseExpression(remoteDirectoryExpression));
|
||||
}
|
||||
|
||||
|
||||
protected final void doSetRemoteDirectoryExpression(Expression expression) {
|
||||
Assert.notNull(expression, "'remoteDirectoryExpression' must not be null");
|
||||
this.remoteDirectoryExpression = expression;
|
||||
@@ -274,7 +273,6 @@ public abstract class AbstractInboundFileSynchronizer<F>
|
||||
this.metadataStorePrefix = metadataStorePrefix;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
@@ -297,7 +295,6 @@ public abstract class AbstractInboundFileSynchronizer<F>
|
||||
doInit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Subclasses can override to perform initialization - called from
|
||||
* {@link InitializingBean#afterPropertiesSet()}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -117,7 +117,6 @@ public abstract class AbstractInboundFileSynchronizingMessageSource<F>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setAutoCreateLocalDirectory(boolean autoCreateLocalDirectory) {
|
||||
this.autoCreateLocalDirectory = autoCreateLocalDirectory;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -137,7 +137,6 @@ public class OSDelegatingFileTailingMessageProducer extends FileTailingMessagePr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs a thread that waits for the Process result.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -37,7 +37,6 @@ public class FileToStringTransformer extends AbstractFilePayloadTransformer<Stri
|
||||
|
||||
private volatile Charset charset = Charset.defaultCharset();
|
||||
|
||||
|
||||
/**
|
||||
* Set the charset name to use when copying the File to a String.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -109,7 +109,6 @@ public class FileOutboundGatewayIntegrationTests {
|
||||
sourceFile.delete();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void instancesCreated() {
|
||||
assertThat(beanFactory.getBean("copier")).isNotNull();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -97,7 +97,6 @@ public class FileReadingMessageSourceIntegrationTests {
|
||||
inputDir.delete();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void configured() throws Exception {
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(pollableFileSource);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2022 the original author or authors.
|
||||
* Copyright 2013-2024 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.
|
||||
@@ -90,7 +90,6 @@ public class FileReadingMessageSourcePersistentFilterIntegrationTests {
|
||||
persistDir.delete();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void configured() throws Exception {
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(this.pollableFileSource);
|
||||
|
||||
@@ -85,7 +85,6 @@ public class FileWritingMessageHandlerTests {
|
||||
|
||||
static final String SAMPLE_CONTENT = "HelloWorld\näöüß";
|
||||
|
||||
|
||||
private File sourceFile;
|
||||
|
||||
@TempDir
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2023 the original author or authors.
|
||||
* Copyright 2015-2024 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.
|
||||
@@ -198,7 +198,6 @@ public class WatchServiceDirectoryScannerTests {
|
||||
|
||||
baz2.delete();
|
||||
|
||||
|
||||
n = 0;
|
||||
while (n++ < 300 && removeFileLatch.getCount() > 0) {
|
||||
Thread.sleep(100);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -45,11 +45,9 @@ public class AutoCreateDirectoryIntegrationTests {
|
||||
System.getProperty("java.io.tmpdir") + File.separator +
|
||||
AutoCreateDirectoryIntegrationTests.class.getSimpleName();
|
||||
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setupNonAutoCreatedDirectories() {
|
||||
new File(BASE_PATH).delete();
|
||||
@@ -63,7 +61,6 @@ public class AutoCreateDirectoryIntegrationTests {
|
||||
new File(BASE_PATH).delete();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void defaultInbound() {
|
||||
Object adapter = context.getBean("defaultInbound");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -36,7 +36,6 @@ import org.springframework.core.io.InputStreamResource;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.integration.file.config;
|
||||
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -48,7 +47,6 @@ public class DefaultConfigurationTests {
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
|
||||
@Test
|
||||
public void verifyErrorChannel() {
|
||||
Object errorChannel = context.getBean(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -55,13 +55,11 @@ public class FileInboundChannelAdapterWithPatternParserTests {
|
||||
|
||||
private DirectFieldAccessor accessor;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setSource(FileReadingMessageSource source) {
|
||||
this.accessor = new DirectFieldAccessor(source);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void channelName() {
|
||||
AbstractMessageChannel channel = context.getBean("adapterWithPattern", AbstractMessageChannel.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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,6 @@ public class FileInboundChannelAdapterWithPreventDuplicatesFlagTests {
|
||||
@Qualifier("testFilter")
|
||||
private TestFileListFilter testFilter;
|
||||
|
||||
|
||||
@Test
|
||||
public void filterAndNull() {
|
||||
FileListFilter<?> filter = this.extractFilter("filterAndNull");
|
||||
@@ -144,7 +143,6 @@ public class FileInboundChannelAdapterWithPreventDuplicatesFlagTests {
|
||||
assertThat(result.size()).isEqualTo(3);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private FileListFilter<File> extractFilter(String beanName) {
|
||||
return (FileListFilter<File>)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -132,10 +132,12 @@ public class FileListFilterFactoryBeanTests {
|
||||
}
|
||||
|
||||
private static class TestFilter extends AbstractFileListFilter<File> {
|
||||
|
||||
@Override
|
||||
public boolean accept(File file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class FileMessageHistoryTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void testMessageHistory() throws Exception {
|
||||
ClassPathXmlApplicationContext context =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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,7 +51,6 @@ public class FileOutboundAdaptersWithClasspathInPropertiesTests {
|
||||
@Qualifier("gateway")
|
||||
private EventDrivenConsumer gateway;
|
||||
|
||||
|
||||
@Test
|
||||
public void outboundChannelAdapter() throws Exception {
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -307,7 +307,6 @@ public class FileOutboundChannelAdapterParserTests {
|
||||
@Test
|
||||
public void adapterUsageWithIgnoreMode() throws Exception {
|
||||
|
||||
|
||||
String expectedFileContent = "Initial File Content:";
|
||||
|
||||
File testFile = new File("test/fileToIgnore.txt");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@SpringJUnitConfig
|
||||
public class InboundAdapterWithLockersTests {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@@ -48,4 +49,5 @@ public class InboundAdapterWithLockersTests {
|
||||
assertThat(TestUtils.getPropertyValue(context.getBean("inputWithLockerD"), "source.scanner.locker"))
|
||||
.isInstanceOf(NioFileLocker.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 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.
|
||||
@@ -403,7 +403,6 @@ public class FileTests {
|
||||
.get();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow fileSplitterFlow(BeanFactory beanFactory) {
|
||||
ExpressionFileListFilter<File> fileExpressionFileListFilter =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -138,7 +138,6 @@ public class CompositeFileListFilterTests {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isForRecursion() {
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2022 the original author or authors.
|
||||
* Copyright 2013-2024 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,6 @@ package org.springframework.integration.file.filters;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.Flushable;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -143,9 +142,6 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF
|
||||
}
|
||||
|
||||
@Test
|
||||
/*
|
||||
* INT-3721: Test all operations that can cause the metadata to be flushed.
|
||||
*/
|
||||
public void testFlush() throws Exception {
|
||||
final AtomicInteger flushes = new AtomicInteger();
|
||||
final AtomicBoolean replaced = new AtomicBoolean();
|
||||
@@ -157,7 +153,7 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
public void close() {
|
||||
flush();
|
||||
}
|
||||
|
||||
@@ -168,6 +164,7 @@ public class PersistentAcceptOnceFileListFilterTests extends AcceptOnceFileListF
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MS store = new MS();
|
||||
String prefix = "flush:";
|
||||
FileSystemPersistentAcceptOnceFileListFilter filter = new FileSystemPersistentAcceptOnceFileListFilter(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -66,7 +66,6 @@ import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @author Liu Jiong
|
||||
@@ -681,7 +680,6 @@ public class RemoteFileOutboundGatewayTests {
|
||||
assertThat(outFile.exists()).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testGet_P() {
|
||||
SessionFactory sessionFactory = mock(SessionFactory.class);
|
||||
@@ -969,7 +967,6 @@ public class RemoteFileOutboundGatewayTests {
|
||||
|
||||
private boolean open;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean remove(String path) {
|
||||
return false;
|
||||
@@ -1049,7 +1046,6 @@ public class RemoteFileOutboundGatewayTests {
|
||||
|
||||
}
|
||||
|
||||
|
||||
static class TestRemoteFileOutboundGateway extends AbstractRemoteFileOutboundGateway<TestLsEntry> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
@@ -46,7 +46,6 @@ public abstract class AbstractFilePayloadTransformerTests<T extends AbstractFile
|
||||
|
||||
File sourceFile;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUpCommonTestData() throws Exception {
|
||||
sourceFile = File.createTempFile("anyFile", ".txt");
|
||||
|
||||
Reference in New Issue
Block a user