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:
committed by
Gary Russell
parent
507764a3d6
commit
f71d6a0e66
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user