|
|
@ -550,6 +550,14 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen |
|
|
|
if (urlBase == null || urlBase.equals("")) { |
|
|
|
if (urlBase == null || urlBase.equals("")) { |
|
|
|
urlBase = "ftp://" + currentServerSettings.getAddress() + "/"; |
|
|
|
urlBase = "ftp://" + currentServerSettings.getAddress() + "/"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String rootDir = ""; |
|
|
|
|
|
|
|
if (urlBase.matches("(ftps?|scp|sftp)://.+/.+")) { |
|
|
|
|
|
|
|
String[] split = urlBase.split("/", 4); |
|
|
|
|
|
|
|
rootDir = "/" + split[3]; |
|
|
|
|
|
|
|
if (!rootDir.endsWith("/")) { |
|
|
|
|
|
|
|
rootDir = rootDir + "/"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Try using AndFTP intents
|
|
|
|
// Try using AndFTP intents
|
|
|
|
Intent andftpStart = new Intent(Intent.ACTION_PICK); |
|
|
|
Intent andftpStart = new Intent(Intent.ACTION_PICK); |
|
|
@ -578,7 +586,7 @@ public class DetailsFragment extends Fragment implements OnTrackersUpdatedListen |
|
|
|
if (file.startsWith("/") && file.indexOf("/", 1) < 0) { |
|
|
|
if (file.startsWith("/") && file.indexOf("/", 1) < 0) { |
|
|
|
file = file.substring(1); |
|
|
|
file = file.substring(1); |
|
|
|
} |
|
|
|
} |
|
|
|
andftpStart.putExtra("remote_file" + (f + 1), file); |
|
|
|
andftpStart.putExtra("remote_file" + (f + 1), rootDir + file); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (andftpStart.resolveActivity(getActivity().getPackageManager()) != null) { |
|
|
|
if (andftpStart.resolveActivity(getActivity().getPackageManager()) != null) { |
|
|
|