Package io.anyline2

Class AssetUtilImpl

    • Constructor Detail

      • AssetUtilImpl

        AssetUtilImpl()
    • Method Detail

      • copyAssetFileWithoutPath

         static void copyAssetFileWithoutPath(Context context, String pathInAssets, File dirToCopyTo, boolean isForceCopy)

        Copy the asset file specified by path directly to the given directory (without the relative path of the asset).

        SHA sum will be calculated and stored to the target dir with .sha ending. Calculating this takes time, prefer auto generating the anyline_assets.json or providing the SHA with copyAssetFileWithoutPath.

        If isForceCopy is false, this will not copy anything if the same .sha file is in the target dir.

        Parameters:
        context - the context
        pathInAssets - Path to asset, relative to app's assets directory.
        dirToCopyTo - the target directory
        isForceCopy - if true the file will always be copied (an sha will be calculated and checked otherwise)
      • copyAssetFileWithoutPath

         static void copyAssetFileWithoutPath(Context context, String pathInAssets, File dirToCopyTo, String shaHash)

        Copy the asset file specified by path directly to the given directory (without the relative path of the asset).

        The file will only be copied if it does not exist in the target location, or the saved sha for that file is different to the one given. (The file will always be copied if the given hash is null)

        Parameters:
        context - the context
        pathInAssets - Path to asset, relative to app's assets directory.
        dirToCopyTo - the target directory
        shaHash - the SHA checksum for the file to copy