mirror of https://github.com/apache/nifi.git
NIFI-8971 Removed legacy FlowFile name and path attributes
This closes #6003 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
99b2412ad4
commit
afdbed5749
|
@ -886,13 +886,6 @@ public class MergeContent extends BinFiles {
|
|||
public void process(final InputStream rawIn) throws IOException {
|
||||
try (final InputStream in = new BufferedInputStream(rawIn)) {
|
||||
final Map<String, String> attributes = new HashMap<>(flowFile.getAttributes());
|
||||
|
||||
// for backward compatibility purposes, we add the "legacy" NiFi attributes
|
||||
attributes.put("nf.file.name", attributes.get(CoreAttributes.FILENAME.key()));
|
||||
attributes.put("nf.file.path", attributes.get(CoreAttributes.PATH.key()));
|
||||
if (attributes.containsKey(CoreAttributes.MIME_TYPE.key())) {
|
||||
attributes.put("content-type", attributes.get(CoreAttributes.MIME_TYPE.key()));
|
||||
}
|
||||
packager.packageFlowFile(in, out, attributes, flowFile.getSize());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -547,12 +547,6 @@ public class UnpackContent extends AbstractProcessor {
|
|||
// and later unpack it -- in this case, we have two FlowFiles with the same UUID.
|
||||
attributes.remove(CoreAttributes.UUID.key());
|
||||
|
||||
// maintain backward compatibility with legacy NiFi attribute names
|
||||
mapAttributes(attributes, "nf.file.name", CoreAttributes.FILENAME.key());
|
||||
mapAttributes(attributes, "nf.file.path", CoreAttributes.PATH.key());
|
||||
mapAttributes(attributes, "content-encoding", CoreAttributes.MIME_TYPE.key());
|
||||
mapAttributes(attributes, "content-type", CoreAttributes.MIME_TYPE.key());
|
||||
|
||||
if (!attributes.containsKey(CoreAttributes.MIME_TYPE.key())) {
|
||||
attributes.put(CoreAttributes.MIME_TYPE.key(), OCTET_STREAM);
|
||||
}
|
||||
|
|
|
@ -345,17 +345,6 @@ public class ListenHTTPServlet extends HttpServlet {
|
|||
} else {
|
||||
attributes.putAll(unpackager.unpackageFlowFile(in, bos));
|
||||
|
||||
if (destinationIsLegacyNiFi) {
|
||||
if (attributes.containsKey("nf.file.name")) {
|
||||
// for backward compatibility with old nifi...
|
||||
attributes.put(CoreAttributes.FILENAME.key(), attributes.remove("nf.file.name"));
|
||||
}
|
||||
|
||||
if (attributes.containsKey("nf.file.path")) {
|
||||
attributes.put(CoreAttributes.PATH.key(), attributes.remove("nf.file.path"));
|
||||
}
|
||||
}
|
||||
|
||||
hasMoreData.set(unpackager.hasMoreData());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue