[ 
https://issues.apache.org/jira/browse/NIFI-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16781867#comment-16781867
 ] 

Ryan Withers commented on NIFI-1693:
------------------------------------

So I think I've found the place where a change like this might go.  Based on 
what I'm seeing I'm thinking the nifi-utils project in the nifi-commons module. 
 I'm thinking of either org.apache.nifi.util.file.FormatUtils or creating a 
separate class for the functionality, so that it stands out and can be found 
more intuitively.  

I'm going to move forward, but wanted to post where I was thinking of adding 
the functionality to get feedback if this was off base. 

Also I disqualified the FileUtils class in the same project because it was 
primarily IO and file operations.  And seems more string format related.  But 
I'm considering this class as well. 

I also looked at Filters and see some of the J2EE servlet filters.  Related to 
that I've been thinking about how to get this implemented in a cross cutting 
way.  Does nifi have a filtering capability as part of the flow that get's 
created?  Looking at central places where I might be able to inspect property 
descriptors.  There are some places I've noticed the formatting applied after a 
PropertyDescriptor.getValue().  If this is the route then I think I'll be 
looking for all places where Descriptors are defined that could have values 
applied with the file shortcut expansion. 

Moving forward and appreciative of any input. 




> Paths do not support user home directory shortcut expansion
> -----------------------------------------------------------
>
>                 Key: NIFI-1693
>                 URL: https://issues.apache.org/jira/browse/NIFI-1693
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.6.0
>            Reporter: Andy LoPresto
>            Assignee: Ryan Withers
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Java file path handling does not support user home directory shortcut 
> expansion ("~" -> "/Users/alopresto" for example). This is well-documented 
> and there are simple fixes [1] for this issue. 
> Recently this was discovered in the {{EncryptContent}} processors when 
> attempting to use a path to the public or secret keyring files that started 
> with the "~" character: i.e. {{~/.gnupg/pubring.gpg}}. 
> This should ideally be offered as a utility method (effectively a "filter" 
> that can be applied to all user-provided paths throughout the application for 
> consistent handling). 
> [1] http://stackoverflow.com/a/7163455/70465



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to