Skip to content

Applet file management

1.convert finfile paths to absolute paths

In some scenarios, we get the file path of the applet and can't get the file data, so we can use this method to convert it to an absolute path. For example, when using the forwarding function of the applet, the returned image path is the applet file path, which can be converted to an absolute path using this method, and then get the image data before calling up the third party share. Another example is that in the custom api, you can pass the parameter of the applet file path, and the host app can get the file data after converting it to an absolute path using this method.

kotlin
 /**
* Convert finfile file paths to absolute paths
* @param context
* @param appId
* @param filePath finfile file path
*/
 fun getFinFileAbsolutePath(context: Context, appId: String,
filePath: String): String?

Example of a call to ####

kotlin
val appletTempPath =
FinAppClient.appletApiManager.getFinFileAbsolutePath(this,
"60964a900f0ca30001292da1", "finfile://tmp_sss.jpg")

2.Get the path to the applet's temporary file storage directory

API

kotlin
/**
* Get the path to the applet's temporary file storage directory
*
* @param context context
* @param appId applet ID
Subscribe to DeepL Pro to edit this document.
Visit www.DeepL.com/profor more information.
* @return path to the directory where the applet's temporary files are
stored
*/
fun getAppletTempPath(context: Context, appId: String): String?

Example of a call to #### :::: tabs ::: tab "Kotlin"

kotlin
val appletTempPath =
FinAppClient.appletApiManager.getAppletTempPath(this, "appId")

:::

::: tab "Java"

java
String appletTempPath = FinAppClient.INSTANCE.getAppletApiManager().
getAppletTempPath(this, "appId");

::: ::::

3.Get the path to the directory where the applet source code is

stored

API

kotlin
/**
* Get the path to the directory where the applet source code is stored
*
* @param context context
* @param appId applet ID
* @return the path to the directory where the applet source code is
stored
*/
fun getAppletSourcePath(context: Context, appId: String): String?

Example of a call to #### :::: tabs ::: tab "Kotlin"

kotlin
val appletSourcePath =
FinAppClient.appletApiManager.getAppletSourcePath(context, "appId")

:::

::: tab "Java"

java
String appletSourcePath = FinAppClient.INSTANCE.getAppletApiManager().
getAppletSourcePath(context, appId);

::: ::::