INT-3262 JDK8 Javadoc Commit
Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`. JIRA: https://jira.springsource.org/browse/INT-3262 JIRA: https://jira.springsource.org/browse/INT-3263
This commit is contained in:
committed by
Artem Bilan
parent
66efb34342
commit
c45b708341
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -52,6 +52,8 @@ public class DefaultFileNameGenerator extends AbstractExpressionEvaluator implem
|
||||
/**
|
||||
* Specify an expression to be evaluated against the Message
|
||||
* in order to generate a file name.
|
||||
*
|
||||
* @param expression The expression.
|
||||
*/
|
||||
public void setExpression(String expression) {
|
||||
Assert.hasText(expression, "expression must not be empty");
|
||||
@@ -61,6 +63,8 @@ public class DefaultFileNameGenerator extends AbstractExpressionEvaluator implem
|
||||
/**
|
||||
* Specify a custom header name to check for the file name.
|
||||
* The default is defined by {@link FileHeaders#FILENAME}.
|
||||
*
|
||||
* @param headerName The header name.
|
||||
*/
|
||||
public void setHeaderName(String headerName) {
|
||||
Assert.notNull(headerName, "'headerName' must not be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -26,7 +26,7 @@ import java.io.File;
|
||||
*
|
||||
* If a filter that respects locks is required extend
|
||||
* {@link org.springframework.integration.file.locking.AbstractFileLockerFilter} instead.
|
||||
*
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @since 2.0
|
||||
*/
|
||||
@@ -37,12 +37,14 @@ public interface FileLocker {
|
||||
* successful, <code>false</code> otherwise.
|
||||
*
|
||||
* @param fileToLock the file that should be locked according to this locker
|
||||
* @return true if successful.
|
||||
*/
|
||||
boolean lock(File fileToLock);
|
||||
|
||||
/**
|
||||
* Checks whether the file passed in can be locked by this locker. This method never changes the locked state.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return true if the file was locked by another locker than this locker
|
||||
*/
|
||||
boolean isLockable(File file);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,8 +34,6 @@ import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.common.LiteralExpression;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandlingException;
|
||||
import org.springframework.integration.expression.ExpressionUtils;
|
||||
import org.springframework.integration.file.support.FileExistsMode;
|
||||
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
|
||||
@@ -44,7 +42,9 @@ import org.springframework.integration.util.DefaultLockRegistry;
|
||||
import org.springframework.integration.util.LockRegistry;
|
||||
import org.springframework.integration.util.PassThruLockRegistry;
|
||||
import org.springframework.integration.util.WhileLockedProcessor;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.messaging.MessageHandlingException;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -132,6 +132,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
* <em>true</em>. If set to <em>false</em> and the
|
||||
* destination directory does not exist, an Exception will be thrown upon
|
||||
* initialization.
|
||||
*
|
||||
* @param autoCreateDirectory true to create the directory if needed.
|
||||
*/
|
||||
public void setAutoCreateDirectory(boolean autoCreateDirectory) {
|
||||
this.autoCreateDirectory = autoCreateDirectory;
|
||||
@@ -142,7 +144,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
* appear in the file system with an additional suffix, which by default is
|
||||
* ".writing". This can be changed by setting this property.
|
||||
*
|
||||
* @param temporaryFileSuffix
|
||||
* @param temporaryFileSuffix The temporary file suffix.
|
||||
*/
|
||||
public void setTemporaryFileSuffix(String temporaryFileSuffix) {
|
||||
Assert.notNull(temporaryFileSuffix, "'temporaryFileSuffix' must not be null"); // empty string is OK
|
||||
@@ -181,6 +183,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
/**
|
||||
* Specify whether a reply Message is expected. If not, this handler will simply return null for a
|
||||
* successful response or throw an Exception for a non-successful response. The default is true.
|
||||
*
|
||||
* @param expectReply true if a reply is expected.
|
||||
*/
|
||||
public void setExpectReply(boolean expectReply) {
|
||||
this.expectReply = expectReply;
|
||||
@@ -193,6 +197,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
/**
|
||||
* Provide the {@link FileNameGenerator} strategy to use when generating
|
||||
* the destination file's name.
|
||||
*
|
||||
* @param fileNameGenerator The file name generator.
|
||||
*/
|
||||
public void setFileNameGenerator(FileNameGenerator fileNameGenerator) {
|
||||
Assert.notNull(fileNameGenerator, "FileNameGenerator must not be null");
|
||||
@@ -206,6 +212,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
* will only have an effect if the inbound Message has a File payload or
|
||||
* a {@link FileHeaders#ORIGINAL_FILE} header value containing either a
|
||||
* File instance or a String representing the original file path.
|
||||
*
|
||||
* @param deleteSourceFiles true to delete the source files.
|
||||
*/
|
||||
public void setDeleteSourceFiles(boolean deleteSourceFiles) {
|
||||
this.deleteSourceFiles = deleteSourceFiles;
|
||||
@@ -214,6 +222,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
/**
|
||||
* Set the charset name to use when writing a File from a String-based
|
||||
* Message payload.
|
||||
*
|
||||
* @param charset The charset.
|
||||
*/
|
||||
public void setCharset(String charset) {
|
||||
Assert.notNull(charset, "charset must not be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Base class for File payload transformer parsers.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public abstract class AbstractFilePayloadTransformerParser extends AbstractTransformerParser {
|
||||
@@ -41,6 +41,10 @@ public abstract class AbstractFilePayloadTransformerParser extends AbstractTrans
|
||||
|
||||
/**
|
||||
* Subclasses may override this method to provide additional configuration.
|
||||
*
|
||||
* @param element The element.
|
||||
* @param parserContext The parser context.
|
||||
* @param builder The builder.
|
||||
*/
|
||||
protected void postProcessTransformer(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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,7 +32,8 @@ public abstract class AbstractFileListFilter<F> implements FileListFilter<F> {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public final List<F> filterFiles(F[] files) {
|
||||
@Override
|
||||
public final List<F> filterFiles(F[] files) {
|
||||
List<F> accepted = new ArrayList<F>();
|
||||
if (files != null) {
|
||||
for (F file : files) {
|
||||
@@ -46,6 +47,9 @@ public abstract class AbstractFileListFilter<F> implements FileListFilter<F> {
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return true if the file passes the filter.
|
||||
*/
|
||||
protected abstract boolean accept(F file);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -52,6 +52,7 @@ public abstract class AbstractRegexPatternFileListFilter<F> extends AbstractFile
|
||||
this.pattern = Pattern.compile(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(this.pattern, "'pattern' must not be null!");
|
||||
}
|
||||
@@ -62,7 +63,10 @@ public abstract class AbstractRegexPatternFileListFilter<F> extends AbstractFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method to extract the file's name.
|
||||
* Subclasses must implement this method to extract the file's name.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return The file name.
|
||||
*/
|
||||
protected abstract String getFilename(F file);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -50,7 +50,10 @@ public abstract class AbstractSimplePatternFileListFilter<F> extends AbstractFil
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method to extract the file's name.
|
||||
* Subclasses must implement this method to extract the file's name.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return The file name.
|
||||
*/
|
||||
protected abstract String getFilename(F file);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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,7 +23,8 @@ package org.springframework.integration.file.filters;
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
* @param <F>
|
||||
*
|
||||
* @param <F> The type that will be filtered.
|
||||
*/
|
||||
public class AcceptAllFileListFilter<F> extends AbstractFileListFilter<F> {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -33,7 +33,8 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
* @param <F>
|
||||
*
|
||||
* @param <F> The type that will be filtered.
|
||||
*/
|
||||
public class CompositeFileListFilter<F> implements FileListFilter<F> {
|
||||
|
||||
@@ -87,6 +88,7 @@ public class CompositeFileListFilter<F> implements FileListFilter<F> {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<F> filterFiles(F[] files) {
|
||||
Assert.notNull(files, "'files' should not be null");
|
||||
List<F> results = new ArrayList<F>(Arrays.asList(files));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 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,9 @@ public interface FileListFilter<F> {
|
||||
/**
|
||||
* Filters out files and returns the files that are left in a list, or an
|
||||
* empty list when a null is passed in.
|
||||
*
|
||||
* @param files The files.
|
||||
* @return The filtered files.
|
||||
*/
|
||||
List<F> filterFiles(F[] files);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 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.
|
||||
@@ -33,7 +33,7 @@ public interface InputStreamCallback {
|
||||
* this method exits.
|
||||
*
|
||||
* @param stream The InputStream.
|
||||
* @throws IOException
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
void doWithInputStream(InputStream stream) throws IOException;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 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,7 +31,6 @@ public interface RemoteFileOperations<F> {
|
||||
*
|
||||
* @param message The message.
|
||||
* @return The remote path, or null if no local file was found.
|
||||
* @throws Exception
|
||||
*/
|
||||
String send(Message<?> message);
|
||||
|
||||
@@ -43,13 +42,13 @@ public interface RemoteFileOperations<F> {
|
||||
* @param message The message.
|
||||
* @param subDirectory The sub directory.
|
||||
* @return The remote path, or null if no local file was found.
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
String send(Message<?> message, String subDirectory);
|
||||
|
||||
/**
|
||||
* Retrieve a remote file as an InputStream, based on information in a message.
|
||||
*
|
||||
* @param message The message.
|
||||
* @param callback the callback.
|
||||
* @return true if the operation was successful.
|
||||
*/
|
||||
@@ -76,6 +75,7 @@ public interface RemoteFileOperations<F> {
|
||||
* Reliably closes the session when the method exits.
|
||||
*
|
||||
* @param callback the SessionCallback.
|
||||
* @param <T> The type returned by {@link SessionCallback#doInSession(org.springframework.integration.file.remote.session.Session)}.
|
||||
* @return The result of the callback method.
|
||||
*/
|
||||
<T> T execute(SessionCallback<F, T> callback);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,6 +20,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import org.springframework.integration.file.remote.session.Session;
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,9 @@ public class RemoteFileUtils {
|
||||
* @param <F> The session type.
|
||||
* @param path The directory path.
|
||||
* @param session The session.
|
||||
* @throws IOException
|
||||
* @param remoteFileSeparator The remote file separator.
|
||||
* @param logger The logger.
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
public static <F> void makeDirectories(String path, Session<F> session, String remoteFileSeparator, Log logger)
|
||||
throws IOException {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 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,7 @@ public interface SessionCallback<F, T> {
|
||||
*
|
||||
* @param session The session.
|
||||
* @return The result of type T.
|
||||
* @throws IOException
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
T doInSession(Session<F> session) throws IOException;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2014 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,7 @@ public abstract class SessionCallbackWithoutResult<F> implements SessionCallback
|
||||
* care of closing the session after this method exits.
|
||||
*
|
||||
* @param session The session.
|
||||
* @throws IOException
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
protected abstract void doInSessionWithoutResult(Session<F> session) throws IOException;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -624,10 +624,14 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
* Copy a remote file to the configured local directory.
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
* @param session
|
||||
* @param remoteDir
|
||||
*@param remoteFilePath @throws IOException
|
||||
* @param message The message.
|
||||
* @param session The session.
|
||||
* @param remoteDir The remote directory.
|
||||
* @param remoteFilePath The remote file path.
|
||||
* @param remoteFilename The remote file name.
|
||||
* @param lsFirst true to execute an 'ls' command first.
|
||||
* @return The file.
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
protected File get(Message<?> message, Session<F> session, String remoteDir, String remoteFilePath, String remoteFilename, boolean lsFirst)
|
||||
throws IOException {
|
||||
@@ -771,7 +775,8 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
}
|
||||
|
||||
/**
|
||||
* @param remoteFilePath
|
||||
* @param remoteFilePath The remote file path.
|
||||
* @return The remote file name.
|
||||
*/
|
||||
protected String getRemoteFilename(String remoteFilePath) {
|
||||
String remoteFileName;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.file.remote.handler;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.file.FileNameGenerator;
|
||||
import org.springframework.integration.file.remote.RemoteFileTemplate;
|
||||
@@ -72,23 +70,14 @@ public class FileTransferringMessageHandler<F> extends AbstractMessageHandler {
|
||||
return this.remoteFileTemplate.getTemporaryFileSuffix();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This property is no longer used; byte[] and String payloads are written directly
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTemporaryDirectory(File temporaryDirectory) {
|
||||
}
|
||||
|
||||
protected boolean isUseTemporaryFileName() {
|
||||
return this.remoteFileTemplate.isUseTemporaryFileName();
|
||||
}
|
||||
|
||||
|
||||
public void setUseTemporaryFileName(boolean useTemporaryFileName) {
|
||||
this.remoteFileTemplate.setUseTemporaryFileName(useTemporaryFileName);
|
||||
}
|
||||
|
||||
|
||||
public void setFileNameGenerator(FileNameGenerator fileNameGenerator) {
|
||||
this.remoteFileTemplate.setFileNameGenerator(fileNameGenerator);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
|
||||
/**
|
||||
* Create a CachingSessionFactory with an unlimited number of sessions.
|
||||
*
|
||||
* @param sessionFactory the underlying session factory.
|
||||
*/
|
||||
public CachingSessionFactory(SessionFactory<F> sessionFactory) {
|
||||
@@ -63,8 +64,9 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
* calling threads will block until a session is available.
|
||||
* @see #setSessionWaitTimeout(long)
|
||||
* @see #setPoolSize(int)
|
||||
* @param sessionFactory the underlying session factory.
|
||||
* @param sessionCacheSize the maximum cache size.
|
||||
*
|
||||
* @param sessionFactory The underlying session factory.
|
||||
* @param sessionCacheSize The maximum cache size.
|
||||
*/
|
||||
public CachingSessionFactory(SessionFactory<F> sessionFactory, int sessionCacheSize) {
|
||||
this.sessionFactory = sessionFactory;
|
||||
@@ -91,6 +93,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
/**
|
||||
* Sets the limit of how long to wait for a session to become available.
|
||||
*
|
||||
* @param sessionWaitTimeout the session wait timeout.
|
||||
* @throws IllegalStateException if the wait expires prior to a Session becoming available.
|
||||
*/
|
||||
public void setSessionWaitTimeout(long sessionWaitTimeout) {
|
||||
@@ -100,6 +103,8 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
/**
|
||||
* Modify the target session pool size; the actual pool size will adjust up/down
|
||||
* to this size as and when sessions are requested or retrieved.
|
||||
*
|
||||
* @param poolSize The pool size.
|
||||
*/
|
||||
public void setPoolSize(int poolSize) {
|
||||
this.pool.setPoolSize(poolSize);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -54,8 +54,9 @@ public interface Session<T> {
|
||||
|
||||
/**
|
||||
* Retrieve a remote file as a raw {@link InputStream}.
|
||||
* @param source The path of the remote file
|
||||
* @param source The path of the remote file.
|
||||
* @return The raw inputStream.
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
InputStream readRaw(String source) throws IOException;
|
||||
|
||||
@@ -63,7 +64,7 @@ public interface Session<T> {
|
||||
* Invoke after closing the InputStream from {@link #readRaw(String)}.
|
||||
* Required by some session providers.
|
||||
* @return true if successful.
|
||||
* @throws IOException
|
||||
* @throws IOException Any IOException.
|
||||
*/
|
||||
boolean finalizeRaw() throws IOException;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -98,6 +98,8 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
|
||||
/**
|
||||
* Create a synchronizer with the {@link SessionFactory} used to acquire {@link Session} instances.
|
||||
*
|
||||
* @param sessionFactory The session factory.
|
||||
*/
|
||||
public AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory) {
|
||||
Assert.notNull(sessionFactory, "sessionFactory must not be null");
|
||||
@@ -121,6 +123,8 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
|
||||
/**
|
||||
* Specify the full path to the remote directory.
|
||||
*
|
||||
* @param remoteDirectory The remote directory.
|
||||
*/
|
||||
public void setRemoteDirectory(String remoteDirectory) {
|
||||
this.remoteDirectory = remoteDirectory;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,8 +22,6 @@ import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.file.FileReadingMessageSource;
|
||||
@@ -31,6 +29,8 @@ import org.springframework.integration.file.filters.AcceptOnceFileListFilter;
|
||||
import org.springframework.integration.file.filters.CompositeFileListFilter;
|
||||
import org.springframework.integration.file.filters.FileListFilter;
|
||||
import org.springframework.integration.file.filters.RegexPatternFileListFilter;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,8 @@ public abstract class AbstractInboundFileSynchronizingMessageSource<F> extends M
|
||||
* <p>
|
||||
* The default is an {@link AcceptOnceFileListFilter} which filters duplicate file
|
||||
* names (processed during the current execution).
|
||||
* @param localFileListFilter
|
||||
*
|
||||
* @param localFileListFilter The local file list filter.
|
||||
*/
|
||||
public void setLocalFilter(FileListFilter<File> localFileListFilter) {
|
||||
this.localFileListFilter = localFileListFilter;
|
||||
@@ -154,6 +155,7 @@ public abstract class AbstractInboundFileSynchronizingMessageSource<F> extends M
|
||||
* If the result is null, it attempts to sync up with the remote directory to populate the file source.
|
||||
* Then, it polls the file source again and returns the result, whether or not it is null.
|
||||
*/
|
||||
@Override
|
||||
public final Message<File> receive() {
|
||||
Assert.state(this.fileSource != null, "fileSource must not be null");
|
||||
Assert.state(this.synchronizer != null, "synchronizer must not be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 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.
|
||||
@@ -54,6 +54,7 @@ public enum FileExistsMode {
|
||||
* {@link IllegalStateException} is thrown.
|
||||
*
|
||||
* @param fileExistsModeAsString Must neither be null nor empty
|
||||
* @return the enum for the string value.
|
||||
*/
|
||||
public static FileExistsMode getForString(String fileExistsModeAsString) {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,11 +21,11 @@ import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.file.FileHeaders;
|
||||
import org.springframework.integration.file.event.FileIntegrationEvent;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS
|
||||
|
||||
/**
|
||||
* A task executor; default is a {@link SimpleAsyncTaskExecutor}.
|
||||
* @param taskExecutor
|
||||
* @param taskExecutor The task executor.
|
||||
*/
|
||||
public void setTaskExecutor(TaskExecutor taskExecutor) {
|
||||
Assert.notNull("'taskExecutor' cannot be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2014 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,16 +21,16 @@ import java.io.File;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.integration.file.FileHeaders;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.integration.transformer.Transformer;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Base class for transformers that convert a File payload.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public abstract class AbstractFilePayloadTransformer<T> implements Transformer {
|
||||
@@ -43,11 +43,14 @@ public abstract class AbstractFilePayloadTransformer<T> implements Transformer {
|
||||
/**
|
||||
* Specify whether to delete the File after transformation.
|
||||
* Default is <em>false</em>.
|
||||
*
|
||||
* @param deleteFiles true to delete the file.
|
||||
*/
|
||||
public void setDeleteFiles(boolean deleteFiles) {
|
||||
this.deleteFiles = deleteFiles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Message<?> transform(Message<?> message) {
|
||||
try {
|
||||
Assert.notNull(message, "Message must not be null");
|
||||
@@ -74,6 +77,10 @@ public abstract class AbstractFilePayloadTransformer<T> implements Transformer {
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method to transform the File contents.
|
||||
*
|
||||
* @param file The file.
|
||||
* @return The result of the transformation.
|
||||
* @throws Exception Any Exception.
|
||||
*/
|
||||
protected abstract T transformFile(File file) throws Exception;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 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,6 +39,8 @@ public class FileToStringTransformer extends AbstractFilePayloadTransformer<Stri
|
||||
|
||||
/**
|
||||
* Set the charset name to use when copying the File to a String.
|
||||
*
|
||||
* @param charset The charset.
|
||||
*/
|
||||
public void setCharset(String charset) {
|
||||
Assert.notNull(charset, "charset must not be null");
|
||||
|
||||
Reference in New Issue
Block a user