checkstyle MutableException
checkstyle EmptyBlock checkstyle fixRightCurly Script checkstyle EmptyStatement checkstyle RightCurly checkstyle TailingWhite checkstyle NeedBraces Fix the line separator in the `fixRightCurly.gradle`
This commit is contained in:
committed by
Artem Bilan
parent
c0b19e61b5
commit
842aded9a4
@@ -20,7 +20,7 @@ import org.springframework.messaging.Message;
|
||||
|
||||
/**
|
||||
* Strategy interface for generating a file name from a message.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public interface FileNameGenerator {
|
||||
|
||||
@@ -905,7 +905,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
;
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,8 @@ public class FileWritingMessageHandlerFactoryBean
|
||||
}
|
||||
else if (this.directoryExpression != null) {
|
||||
handler = new FileWritingMessageHandler(this.directoryExpression);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Either directory or directoryExpression must not be null");
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class AbstractPersistentAcceptOnceFileListFilter<F> extends Abst
|
||||
if (this.store.replace(key, oldValue, newValue)) {
|
||||
flushIfNeeded();
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Implementation of AbstractRegexPatternMatchingFileListFilter for java.io.File instances.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class RegexPatternFileListFilter extends AbstractRegexPatternFileListFilter<File> {
|
||||
|
||||
@@ -50,7 +50,8 @@ public class NioFileLocker extends AbstractFileLockerFilter {
|
||||
FileLock newLock = null;
|
||||
try {
|
||||
newLock = FileChannelCache.tryLockFor(fileToLock);
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new MessagingException("Failed to lock file: "
|
||||
+ fileToLock, e);
|
||||
}
|
||||
@@ -73,7 +74,8 @@ public class NioFileLocker extends AbstractFileLockerFilter {
|
||||
fileLock.release();
|
||||
}
|
||||
FileChannelCache.closeChannelFor(fileToUnlock);
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new MessagingException("Failed to unlock file: "
|
||||
+ fileToUnlock, e);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Date;
|
||||
/**
|
||||
* Abstract implementation of {@link FileInfo}; provides a setter
|
||||
* for the remote directory and a generic toString implementation.
|
||||
*
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @since 2.1
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.integration.file.remote.session;
|
||||
|
||||
/**
|
||||
* Factory for acquiring {@link Session} instances.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @since 2.0
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.io.File;
|
||||
|
||||
/**
|
||||
* Strategy for synchronizing from a remote File system to a local directory.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @since 2.0
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -96,7 +96,8 @@ public abstract class AbstractFilePayloadTransformer<T> implements Transformer,
|
||||
}
|
||||
}
|
||||
return transformedMessage;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new MessagingException(message, "failed to transform File Message", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
* A payload transformer that copies a File's contents to a byte array.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class FileToByteArrayTransformer extends AbstractFilePayloadTransformer<byte[]> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -120,7 +120,8 @@ public class FileOutboundChannelAdapterIntegrationTests {
|
||||
|
||||
try {
|
||||
this.inputChannelSaveToSubDirWrongExpression.send(message);
|
||||
} catch (MessageHandlingException e) {
|
||||
}
|
||||
catch (MessageHandlingException e) {
|
||||
Assert.assertEquals(
|
||||
TestUtils.applySystemFileSeparator("Destination path [target/base-directory/sub-directory/foo.txt] does not point to a directory."),
|
||||
e.getCause().getMessage());
|
||||
@@ -135,7 +136,8 @@ public class FileOutboundChannelAdapterIntegrationTests {
|
||||
|
||||
try {
|
||||
this.inputChannelSaveToSubDirEmptyStringExpression.send(message);
|
||||
} catch (MessageHandlingException e) {
|
||||
}
|
||||
catch (MessageHandlingException e) {
|
||||
Assert.assertEquals("Unable to resolve destination directory name for the provided Expression '' ''.", e.getCause().getMessage());
|
||||
return;
|
||||
}
|
||||
@@ -159,7 +161,8 @@ public class FileOutboundChannelAdapterIntegrationTests {
|
||||
|
||||
try {
|
||||
this.inputChannelSaveToSubDirAutoCreateOff.send(message);
|
||||
} catch (MessageHandlingException e) {
|
||||
}
|
||||
catch (MessageHandlingException e) {
|
||||
Assert.assertEquals(
|
||||
TestUtils.applySystemFileSeparator("Destination directory [target/base-directory2/sub-directory2] does not exist."),
|
||||
e.getCause().getMessage());
|
||||
@@ -190,7 +193,8 @@ public class FileOutboundChannelAdapterIntegrationTests {
|
||||
|
||||
try {
|
||||
this.inputChannelSaveToSubDirWithFile.send(messageWithFileHeader);
|
||||
} catch (MessageHandlingException e) {
|
||||
}
|
||||
catch (MessageHandlingException e) {
|
||||
Assert.assertEquals("The provided destinationDirectoryExpression " +
|
||||
"(headers['subDirectory']) must not resolve to null.",
|
||||
e.getCause().getMessage());
|
||||
@@ -211,7 +215,8 @@ public class FileOutboundChannelAdapterIntegrationTests {
|
||||
|
||||
try {
|
||||
this.inputChannelSaveToSubDirWithFile.send(messageWithFileHeader);
|
||||
} catch (MessageHandlingException e) {
|
||||
}
|
||||
catch (MessageHandlingException e) {
|
||||
Assert.assertEquals("The provided destinationDirectoryExpression" +
|
||||
" (headers['subDirectory']) must be of type " +
|
||||
"java.io.File or be a String.",
|
||||
|
||||
@@ -48,7 +48,7 @@ public class FileInboundChannelAdapterWithClasspathInPropertiesTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void inputDirectory() throws Exception {
|
||||
public void inputDirectory() throws Exception {
|
||||
File expected = new ClassPathResource("").getFile();
|
||||
File actual = (File) accessor.getPropertyValue("directory");
|
||||
assertEquals("'directory' should be set", expected, actual);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 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,8 @@ public class FileOutboundChannelAdapterParserWithErrorsTests {
|
||||
|
||||
try {
|
||||
new ClassPathXmlApplicationContext("FileOutboundChannelAdapterParserWithErrorsTests-context.xml", getClass());
|
||||
} catch (BeanDefinitionParsingException e) {
|
||||
}
|
||||
catch (BeanDefinitionParsingException e) {
|
||||
assertEquals("Configuration problem: Either directory or " +
|
||||
"directory-expression must be provided but not both\nOffending " +
|
||||
"resource: class path " +
|
||||
@@ -53,7 +54,8 @@ public class FileOutboundChannelAdapterParserWithErrorsTests {
|
||||
|
||||
try {
|
||||
new ClassPathXmlApplicationContext("FileOutboundChannelAdapterParserWithErrors2Tests-context.xml", getClass());
|
||||
} catch (BeanDefinitionParsingException e) {
|
||||
}
|
||||
catch (BeanDefinitionParsingException e) {
|
||||
assertEquals("Configuration problem: directory or directory-expression " +
|
||||
"is required\nOffending resource: class path resource " +
|
||||
"[org/springframework/integration/file/config/FileOutboundChannelAdapterParserWithErrors2Tests-context.xml]",
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SimplePatternFileListFilterTests {
|
||||
public void shouldMatchQuestionMark() {
|
||||
assertThat(new SimplePatternFileListFilter("*bar").accept(new File("bar")), is(true));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void shouldMatchWildcard() {
|
||||
assertThat(new SimplePatternFileListFilter("ba?").accept(new File("bar")), is(true));
|
||||
|
||||
Reference in New Issue
Block a user