INT-2964 Various JavaDoc Fixes
INT-2964 - JavaDoc: <emphasis> should be <em>
INT-2964 - JavaDoc: <p/> should be <p>
INT-2964 - JavaDoc polishing
* <li></li> should be wrapped in <ul></ul>
* wrap code snippets in {@code myCode()}
* change <code>false</false> to <code>false</code>
INT-2964 - Polish - Fix more JavaDoc errors
* Mockito-all dependency causes JavaDoc error. Change dependency to Mockito-Core.
This commit is contained in:
committed by
Gary Russell
parent
4c348d3785
commit
05062aa0b2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.integration.file.filters.FileListFilter;
|
||||
/**
|
||||
* Default directory scanner and base class for other directory scanners.
|
||||
* Manages the default interrelations between filtering, scanning and locking.
|
||||
*
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @since 2.0
|
||||
*/
|
||||
@@ -52,7 +52,7 @@ public class DefaultDirectoryScanner implements DirectoryScanner {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* <p/>
|
||||
* <p>
|
||||
* This class takes the minimal implementation and merely delegates to the
|
||||
* locker if set.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public class DefaultDirectoryScanner implements DirectoryScanner {
|
||||
/**
|
||||
* Subclasses may refine the listing strategy by overriding this method. The
|
||||
* files returned here are passed onto the filter.
|
||||
*
|
||||
*
|
||||
* @param directory root directory to use for listing
|
||||
* @return the files this scanner should consider
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.integration.file.filters.FileListFilter;
|
||||
* intended to enable the customization of selection, locking and ordering of
|
||||
* files in a directory like RecursiveDirectoryScanner. If the only requirement
|
||||
* is to ignore certain files a EntryListFilter implementation should suffice.
|
||||
*
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
*/
|
||||
public interface DirectoryScanner {
|
||||
@@ -36,7 +36,7 @@ public interface DirectoryScanner {
|
||||
* Scans the directory according to the strategy particular to this
|
||||
* implementation and returns the selected files as a File array. This
|
||||
* method may never return files that are rejected by the filter.
|
||||
*
|
||||
*
|
||||
* @param directory the directory to scan for files
|
||||
* @return a list of files representing the content of the directory
|
||||
* @throws IllegalArgumentException if the input is incorrect
|
||||
@@ -48,7 +48,7 @@ public interface DirectoryScanner {
|
||||
* chance to reject files before the scanner presents them through its
|
||||
* listFiles method. A scanner may use additional filtering that is out of
|
||||
* the control of the provided filter.
|
||||
*
|
||||
*
|
||||
* @param filter
|
||||
* the custom filter to be used
|
||||
*/
|
||||
@@ -57,7 +57,7 @@ public interface DirectoryScanner {
|
||||
/**
|
||||
* Sets a custom locker to be used by this scanner. The locker will get a
|
||||
* chance to lock files and reject claims on files that are already locked.
|
||||
*
|
||||
*
|
||||
* @param locker
|
||||
* the custom locker to be used
|
||||
*/
|
||||
@@ -67,10 +67,9 @@ public interface DirectoryScanner {
|
||||
* Claim the file to process. It is up to the implementation to decide what
|
||||
* additional safe guards are required to attain a claim to the file. But if
|
||||
* a locker is set implementations MUST invoke its <code>lock</code> method
|
||||
* and MUST return <code>false<code> if the locker did not grant the lock.
|
||||
*
|
||||
* @param file
|
||||
* file to be claimed
|
||||
* and MUST return <code>false</code> if the locker did not grant the lock.
|
||||
*
|
||||
* @param file file to be claimed
|
||||
* @return true if the claim was granted false otherwise
|
||||
*/
|
||||
boolean tryClaim(File file);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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,7 +20,7 @@ import java.io.File;
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
* A simple wrapper for a Message<File>; used for
|
||||
* A simple wrapper for a {@code Message<File>;} used for
|
||||
* file disposition after the send completes, or
|
||||
* after the transaction commits with a transactional
|
||||
* poller.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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,7 +43,7 @@ import org.springframework.util.Assert;
|
||||
* default, an
|
||||
* {@link AcceptOnceFileListFilter}
|
||||
* is used. It ensures files are picked up only once from the directory.
|
||||
* <p/>
|
||||
* <p>
|
||||
* A common problem with reading files is that a file may be detected before it
|
||||
* is ready. The default {@link AcceptOnceFileListFilter}
|
||||
* does not prevent this. In most cases, this can be prevented if the
|
||||
@@ -51,12 +51,12 @@ import org.springframework.util.Assert;
|
||||
* pattern-matching filter that accepts only files that are ready (e.g. based on
|
||||
* a known suffix), composed with the default {@link AcceptOnceFileListFilter}
|
||||
* would allow for this.
|
||||
* <p/>
|
||||
* <p>
|
||||
* A {@link Comparator} can be used to ensure internal ordering of the Files in
|
||||
* a {@link PriorityBlockingQueue}. This does not provide the same guarantees as
|
||||
* a {@link ResequencingMessageGroupProcessor}, but in cases where writing files
|
||||
* and failure downstream are rare it might be sufficient.
|
||||
* <p/>
|
||||
* <p>
|
||||
* FileReadingMessageSource is fully thread-safe under concurrent
|
||||
* <code>receive()</code> invocations and message delivery callbacks.
|
||||
*
|
||||
@@ -120,12 +120,12 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement
|
||||
/**
|
||||
* Creates a FileReadingMessageSource with a {@link PriorityBlockingQueue}
|
||||
* ordered with the passed in {@link Comparator}
|
||||
* <p/>
|
||||
* <p>
|
||||
* The size of the queue used should be large enough to hold all the files
|
||||
* in the input directory in order to sort all of them, so restricting the
|
||||
* size of the queue is mutually exclusive with ordering. No guarantees
|
||||
* about file delivery order can be made under concurrent access.
|
||||
* <p/>
|
||||
* <p>
|
||||
*
|
||||
* @param receptionOrderComparator
|
||||
* the comparator to be used to order the files in the internal
|
||||
@@ -160,7 +160,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement
|
||||
/**
|
||||
* Specify whether to create the source directory automatically if it does
|
||||
* not yet exist upon initialization. By default, this value is
|
||||
* <emphasis>true</emphasis>. If set to <emphasis>false</emphasis> and the
|
||||
* <em>true</em>. If set to <em>false</em> and the
|
||||
* source directory does not exist, an Exception will be thrown upon
|
||||
* initialization.
|
||||
*
|
||||
@@ -180,7 +180,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement
|
||||
* filters are required a
|
||||
* {@link org.springframework.integration.file.filters.CompositeFileListFilter}
|
||||
* can be used to group them together.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <b>The supplied filter must be thread safe.</b>.
|
||||
*
|
||||
* @param filter a filter
|
||||
@@ -193,7 +193,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement
|
||||
/**
|
||||
* Optional. Sets a {@link FileLocker} to be used to guard files against
|
||||
* duplicate processing.
|
||||
* <p/>
|
||||
* <p>
|
||||
* <b>The supplied FileLocker must be thread safe</b>
|
||||
*
|
||||
* @param locker a locker
|
||||
@@ -206,7 +206,7 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement
|
||||
/**
|
||||
* Optional. Set this flag if you want to make sure the internal queue is
|
||||
* refreshed with the latest content of the input directory on each poll.
|
||||
* <p/>
|
||||
* <p>
|
||||
* By default this implementation will empty its queue before looking at the
|
||||
* directory again. In cases where order is relevant it is important to
|
||||
* consider the effects of setting this flag. The internal
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -121,7 +121,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
|
||||
/**
|
||||
* Specify whether to create the destination directory automatically if it
|
||||
* does not yet exist upon initialization. By default, this value is
|
||||
* <emphasis>true</emphasis>. If set to <emphasis>false</emphasis> and the
|
||||
* <em>true</em>. If set to <em>false</em> and the
|
||||
* destination directory does not exist, an Exception will be thrown upon
|
||||
* initialization.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2013 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,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
* {@link FileListFilter} that passes files only one time. This can
|
||||
* conveniently be used to prevent duplication of files, as is done in
|
||||
* {@link org.springframework.integration.file.FileReadingMessageSource}.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This implementation is thread safe.
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CompositeFileListFilter<F> implements FileListFilter<F> {
|
||||
|
||||
/**
|
||||
* Not thread safe. Only a single thread may add filters at a time.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Add the new filters to this CompositeFileListFilter while maintaining the existing filters.
|
||||
*
|
||||
* @param filtersToAdd a list of filters to add
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2013 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,9 +39,9 @@ final class FileChannelCache {
|
||||
/**
|
||||
* Try to get a lock for this file while guaranteeing that the same channel will be used for all file locks in this
|
||||
* VM. If the lock could not be acquired this method will return <code>null</code>.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Locks acquired through this method should be passed back to #closeChannelFor to prevent memory leaks.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Thread safe.
|
||||
*/
|
||||
public static FileLock tryLockFor(File fileToLock) throws IOException {
|
||||
@@ -65,7 +65,7 @@ final class FileChannelCache {
|
||||
|
||||
/**
|
||||
* Close the channel for the file passed in.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Thread safe.
|
||||
*/
|
||||
public static void closeChannelFor(File fileToUnlock) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2013 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,7 +29,7 @@ import java.util.concurrent.ConcurrentMap;
|
||||
* File locking strategy that uses java.nio. The locks taken by FileChannel are shared with all the threads in a single
|
||||
* JVM, so this locking strategy <b>does not</b> prevent files being picked up multiple times within the same JVM.
|
||||
* {@link FileReadingMessageSource}s sharing a Locker will not pick up the same files.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This implementation will acquire or create a {@link FileLock} for the given file. Caching locks might be expensive,
|
||||
* so this locking strategy is not recommended for scenarios where many files are accessed in parallel.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -94,7 +94,7 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
private volatile String temporaryFileSuffix = ".writing";
|
||||
|
||||
/**
|
||||
* An {@link FileListFilter} that runs against the <emphasis>remote</emphasis> file system view.
|
||||
* An {@link FileListFilter} that runs against the <em>remote</em> file system view.
|
||||
*/
|
||||
private volatile FileListFilter<F> filter;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -47,7 +47,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
public CachingSessionFactory(SessionFactory<F> sessionFactory) {
|
||||
this(sessionFactory, 0);
|
||||
}
|
||||
|
||||
|
||||
public CachingSessionFactory(SessionFactory<F> sessionFactory, int sessionCacheSize) {
|
||||
this.sessionFactory = sessionFactory;
|
||||
this.pool = new SimplePool<Session<F>>(sessionCacheSize, new SimplePool.PoolItemCallback<Session<F>>() {
|
||||
@@ -67,9 +67,9 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
|
||||
|
||||
/**
|
||||
* Sets the limit of how long to wait for a session to become available.
|
||||
*
|
||||
* @throws {@link IllegalStateException} if the wait expires prior to a Session becoming available.
|
||||
* Sets the limit of how long to wait for a session to become available.
|
||||
*
|
||||
* @throws IllegalStateException if the wait expires prior to a Session becoming available.
|
||||
*/
|
||||
public void setSessionWaitTimeout(long sessionWaitTimeout) {
|
||||
this.pool.setWaitTimeout(sessionWaitTimeout);
|
||||
@@ -140,7 +140,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
public boolean mkdir(String directory) throws IOException {
|
||||
return this.targetSession.mkdir(directory);
|
||||
}
|
||||
|
||||
|
||||
public boolean exists(String path) throws IOException{
|
||||
return this.targetSession.exists(path);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2013 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,11 +40,11 @@ import org.springframework.util.ObjectUtils;
|
||||
/**
|
||||
* Base class charged with knowing how to connect to a remote file system,
|
||||
* scan it for new files and then download the files.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The implementation should run through any configured
|
||||
* {@link org.springframework.integration.file.filters.FileListFilter}s to
|
||||
* ensure the file entry is acceptable.
|
||||
*
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -76,12 +76,12 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
private final SessionFactory<F> sessionFactory;
|
||||
|
||||
/**
|
||||
* An {@link FileListFilter} that runs against the <emphasis>remote</emphasis> file system view.
|
||||
* An {@link FileListFilter} that runs against the <em>remote</em> file system view.
|
||||
*/
|
||||
private volatile FileListFilter<F> filter;
|
||||
|
||||
/**
|
||||
* Should we <emphasis>delete</emphasis> the remote <b>source</b> files
|
||||
* Should we <em>delete</em> the remote <b>source</b> files
|
||||
* after copying to the local directory? By default this is false.
|
||||
*/
|
||||
private volatile boolean deleteRemoteFiles;
|
||||
@@ -132,7 +132,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
protected final List<F> filterFiles(F[] files) {
|
||||
return (this.filter != null) ? this.filter.filterFiles(files) : Arrays.asList(files);
|
||||
}
|
||||
|
||||
|
||||
protected String getTemporaryFileSuffix() {
|
||||
return temporaryFileSuffix;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
File localFile = new File(localDirectory, localFileName);
|
||||
if (!localFile.exists()) {
|
||||
String tempFileName = localFile.getAbsolutePath() + this.temporaryFileSuffix;
|
||||
@@ -211,7 +211,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
catch (Exception ignored2) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (tempFile.renameTo(localFile)) {
|
||||
if (this.deleteRemoteFiles) {
|
||||
session.remove(remoteFilePath);
|
||||
@@ -222,7 +222,7 @@ public abstract class AbstractInboundFileSynchronizer<F> implements InboundFileS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String generateLocalFileName(String remoteFileName){
|
||||
if (this.localFilenameGeneratorExpression != null){
|
||||
return this.localFilenameGeneratorExpression.getValue(evaluationContext, remoteFileName, String.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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,12 +40,12 @@ import org.springframework.util.Assert;
|
||||
* files TO the remote file system that exist uniquely in the local file system.
|
||||
* It only handles pulling from the remote file system - as you would expect
|
||||
* from an 'inbound' adapter).
|
||||
* <p/>
|
||||
* <p>
|
||||
* The base class supports configuration of whether the remote file system and
|
||||
* local file system's directories should be created on start (what 'creating a
|
||||
* directory' means to the specific adapter is of course implementation
|
||||
* specific).
|
||||
* <p/>
|
||||
* <p>
|
||||
* This class is to be used as a pair with an implementation of
|
||||
* {@link AbstractInboundFileSynchronizer}. The synchronizer must
|
||||
* handle the work of actually connecting to the remote file system and
|
||||
|
||||
Reference in New Issue
Block a user