mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
made getEntry of FileUtils public in order to avoid duplicate code in FileTransfer
This commit is contained in:
parent
75963c88d5
commit
8dbb8f58b1
@ -405,14 +405,9 @@ public class FileTransfer extends Plugin {
|
||||
Log.d(LOG_TAG, "Saved file: " + filePath);
|
||||
|
||||
// create FileEntry object
|
||||
JSONObject entry = new JSONObject();
|
||||
FileUtils fileUtil = new FileUtils();
|
||||
|
||||
entry.put("isFile", file.isFile());
|
||||
entry.put("isDirectory", file.isDirectory());
|
||||
entry.put("name", file.getName());
|
||||
entry.put("fullPath", file.getAbsolutePath());
|
||||
|
||||
return entry;
|
||||
return fileUtil.getEntry(file);
|
||||
} catch (Exception e) {
|
||||
Log.d(LOG_TAG, e.getMessage(), e);
|
||||
throw new IOException("Error while downloading");
|
||||
|
@ -838,7 +838,7 @@ public class FileUtils extends Plugin {
|
||||
* @return
|
||||
* @throws JSONException
|
||||
*/
|
||||
private JSONObject getEntry(File file) throws JSONException {
|
||||
public JSONObject getEntry(File file) throws JSONException {
|
||||
JSONObject entry = new JSONObject();
|
||||
|
||||
entry.put("isFile", file.isFile());
|
||||
|
Loading…
Reference in New Issue
Block a user