Skip to content

Commit

Permalink
NIFI-631: Correct the WritesAttributes descriptions.
Browse files Browse the repository at this point in the history
Reviewed and Ammended (based on comments from dev list) by Tony Kurc ([email protected])
  • Loading branch information
jskora authored and trkurc committed Nov 25, 2015
1 parent ba83bf9 commit 226ac64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class FetchFile extends AbstractProcessor {
.description("The fully-qualified filename of the file to fetch from the file system")
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.expressionLanguageSupported(true)
.defaultValue("${path}/${filename}")
.defaultValue("${absolute.path}/${filename}")
.required(true)
.build();
static final PropertyDescriptor COMPLETION_STRATEGY = new PropertyDescriptor.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@
"GetFile, this Processor does not delete any data from the local filesystem.")
@WritesAttributes({
@WritesAttribute(attribute="filename", description="The name of the file that was read from filesystem."),
@WritesAttribute(attribute="path", description="The path is set to the absolute path of the file's directory " +
"on filesystem. For example, if the Directory property is set to /tmp, then files picked up from " +
"/tmp will have the path attribute set to \"./\". If the Recurse Subdirectories property is set to " +
"true and a file is picked up from /tmp/abc/1/2/3, then the path attribute will be set to " +
"\"/tmp/abc/1/2/3\"."),
@WritesAttribute(attribute="path", description="The path is set to the relative path of the file's directory " +
"on filesystem compared to the Input Directory property. For example, if Input Directory is set to " +
"/tmp, then files picked up from /tmp will have the path attribute set to \"/\". If the Recurse " +
"Subdirectories property is set to true and a file is picked up from /tmp/abc/1/2/3, then the path " +
"attribute will be set to \"abc/1/2/3/\"."),
@WritesAttribute(attribute="absolute.path", description="The absolute.path is set to the absolute path of " +
"the file's directory on filesystem. For example, if the Input Directory property is set to /tmp, " +
"then files picked up from /tmp will have the path attribute set to \"/tmp/\". If the Recurse " +
"Subdirectories property is set to true and a file is picked up from /tmp/abc/1/2/3, then the path " +
"attribute will be set to \"/tmp/abc/1/2/3/\"."),
@WritesAttribute(attribute="fs.owner", description="The user that owns the file in filesystem"),
@WritesAttribute(attribute="fs.group", description="The group that owns the file in filesystem"),
@WritesAttribute(attribute="fs.lastModified", description="The timestamp of when the file in filesystem was " +
Expand Down Expand Up @@ -217,9 +222,7 @@ protected Map<String, String> createAttributes(final FileInfo fileInfo, final Pr

final Path relativePath = directoryPath.relativize(filePath.getParent());
String relativePathString = relativePath.toString() + "/";
if (relativePathString.isEmpty()) {
relativePathString = "./";
}

final Path absPath = filePath.toAbsolutePath();
final String absPathString = absPath.getParent().toString() + "/";

Expand Down

0 comments on commit 226ac64

Please sign in to comment.