INT-4154: Merge Files Java DSL

JIRA: https://jira.spring.io/browse/INT-4154

* Move `Transformers` for files to the `Files` factory
* Remove `@Deprecated` methods
* Fix `FilesTests` for new packages and removed methods like `.handleWithAdapter()`

Provide JavaDocs for File DSL and implement some new methods like `chmod()` and `renameFunction()`

Fix race condition in the `ScriptsTests` when even small time window delay may lead us to one more message in the queue
This commit is contained in:
Artem Bilan
2016-11-04 16:23:43 -04:00
committed by Gary Russell
parent 507764a3d6
commit f71d6a0e66
16 changed files with 2286 additions and 22 deletions

View File

@@ -36,6 +36,7 @@ import org.springframework.integration.transformer.ObjectToStringTransformer;
import org.springframework.integration.transformer.PayloadDeserializingTransformer;
import org.springframework.integration.transformer.PayloadSerializingTransformer;
import org.springframework.integration.transformer.PayloadTypeConvertingTransformer;
import org.springframework.integration.transformer.StreamTransformer;
import org.springframework.integration.transformer.SyslogToMapTransformer;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
@@ -231,4 +232,22 @@ public abstract class Transformers {
return new DecodingTransformer<>(codec, typeExpression);
}
/**
* The factory method for the {@link StreamTransformer}.
* @return the {@link StreamTransformer} instance.
*/
public static StreamTransformer fromStream() {
return fromStream(null);
}
/**
* Create an instance with the charset to convert the stream to a
* String; if null a {@code byte[]} will be produced instead.
* @param charset the charset.
* @return the {@link StreamTransformer} instance.
*/
public static StreamTransformer fromStream(String charset) {
return new StreamTransformer(charset);
}
}