Skip to content

Commit

Permalink
Use StringBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Feb 7, 2018
1 parent 4b3febd commit 85c8ba4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ public static String getCordovaPluginJS(Context context) {
}

public static String getFilesContent(Context context, String path) {
String currentContent = "";
StringBuilder builder = new StringBuilder();
try {
String[] content = context.getAssets().list(path);
if (content.length > 0) {
for (String file: content) {
currentContent += getFilesContent(context, path+"/"+file);
builder.append(getFilesContent(context, path + "/" + file));
}
} else {
return getJS(context, path);
}
} catch(IOException ex) {
Log.e(Bridge.TAG, "Unable to read file at path "+path);
}
return currentContent;
return builder.toString();
}

private static String generateMethodJS(PluginHandle plugin, PluginMethodHandle method) {
Expand Down

0 comments on commit 85c8ba4

Please sign in to comment.