diff --git a/org.springframework.integration.file/src/main/java/org/springframework/integration/file/FileHeaders.java b/org.springframework.integration.file/src/main/java/org/springframework/integration/file/FileHeaders.java index 14352b8eae..ae10471a07 100644 --- a/org.springframework.integration.file/src/main/java/org/springframework/integration/file/FileHeaders.java +++ b/org.springframework.integration.file/src/main/java/org/springframework/integration/file/FileHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 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. @@ -30,4 +30,6 @@ public abstract class FileHeaders { public static final String FILENAME = PREFIX + "name"; + public static final String ORIGINAL_FILE = PREFIX + "originalFile"; + } diff --git a/org.springframework.integration.file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java b/org.springframework.integration.file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java index f7381d80ff..6683e998b2 100644 --- a/org.springframework.integration.file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java +++ b/org.springframework.integration.file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 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. @@ -58,6 +58,7 @@ public abstract class AbstractFilePayloadTransformer implements Transformer { T result = this.transformFile(file); Message transformedMessage = MessageBuilder.withPayload(result) .copyHeaders(message.getHeaders()) + .setHeaderIfAbsent(FileHeaders.ORIGINAL_FILE, file) .setHeaderIfAbsent(FileHeaders.FILENAME, file.getName()) .build(); if (this.deleteFiles) {