This commit is contained in:
Mark Fisher
2009-06-24 23:52:28 +00:00
parent cb94548996
commit cb7fd4e9b5
2 changed files with 5 additions and 2 deletions

View File

@@ -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";
}

View File

@@ -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<T> 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) {