Android java : How to copy/move file from assets to absolute path?

    private void moveAssets(String assets_file_path, String absolutePath) throws IOException {
        File wwwFile = new File(absolutePath);
        if (wwwFile.exists())
            return;
        InputStream is = activity.getAssets().open(assets_file_path);
        byte[] buffer = new byte[is.available()];
        is.read(buffer);
        is.close();
        wwwFile.createNewFile();
        FileOutputStream os = new FileOutputStream(wwwFile);
        os.write(buffer);
        os.close();
    }

No comments:

Post a Comment

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...