Skip to content

Commit

Permalink
return the actual path for local files
Browse files Browse the repository at this point in the history
Signed-off-by: VishnuSanal <[email protected]>
  • Loading branch information
VishnuSanal committed Jun 14, 2023
1 parent 3a8652a commit f23522e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,15 @@ public Long execute(@NonNull SFTPClient client) throws IOException {
}

/**
* Path accessor. Avoid direct access to path since path may have been URL encoded.
* Path accessor. Avoid direct access to path (for non-local files) since path may have been URL
* encoded.
*
* @return URL decoded path
* @return URL decoded path (for non-local files); the actual path for local files
*/
public String getPath() {

if (isLocal() || isRoot() || isDocumentFile() || isAndroidDataDir()) return path;

try {
return URLDecoder.decode(path.replace("+", "%2b"), "UTF-8");
} catch (UnsupportedEncodingException | IllegalArgumentException e) {
Expand Down

0 comments on commit f23522e

Please sign in to comment.