Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdeconnect-android
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Weixuan Xiao
kdeconnect-android
Commits
a1467675
Commit
a1467675
authored
Mar 23, 2019
by
Erik Duisters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle non-root tree-uri's
parent
315d9657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
src/org/kde/kdeconnect/Plugins/SftpPlugin/AndroidSafFileSystemView.java
...econnect/Plugins/SftpPlugin/AndroidSafFileSystemView.java
+15
-1
No files found.
src/org/kde/kdeconnect/Plugins/SftpPlugin/AndroidSafFileSystemView.java
View file @
a1467675
...
...
@@ -106,7 +106,21 @@ public class AndroidSafFileSystemView implements FileSystemView {
String
parentDocumentId
=
treeDocumentId
+
(
parentSuffix
.
equals
(
"/"
)
?
""
:
parentSuffix
.
substring
(
1
));
Uri
parentUri
=
DocumentsContract
.
buildDocumentUriUsingTree
(
treeUri
,
parentDocumentId
);
Uri
documentUri
=
DocumentsContract
.
buildDocumentUriUsingTree
(
treeUri
,
treeDocumentId
+
nameWithoutRoot
.
substring
(
1
));
/*
When sharing a root document tree like "Internal Storage" documentUri looks like:
content://com.android.externalstorage.documents/tree/primary:/document/primary:
For a file or folder beneath that the uri looks like:
content://com.android.externalstorage.documents/tree/primary:/document/primary:Folder/file.txt
Sharing a non root document tree the documentUri looks like:
content://com.android.externalstorage.documents/tree/primary:/document/primary:Download
For a file or folder beneath that the uri looks like:
content://com.android.externalstorage.documents/tree/primary:/document/primary:Download/Folder/file.txt
*/
String
documentId
=
treeDocumentId
+
(
treeDocumentId
.
endsWith
(
":"
)
?
nameWithoutRoot
.
substring
(
1
)
:
nameWithoutRoot
);
Uri
documentUri
=
DocumentsContract
.
buildDocumentUriUsingTree
(
treeUri
,
documentId
);
return
createAndroidSafSshFile
(
parentUri
,
documentUri
,
filename
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment