public void copyResourcesToCacheIfRequired1(Activity activity){
        if( ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED )
            return;
        String sigFilePath = resFolderPath + "/sarvamoola/aitareya.txt";
        File sigFile = new File(sigFilePath);
        if(!sigFile.exists())
        {
            for (Pair<String, String> item : mFilesToCopy) {
                String fileName ;
                if(item.first.indexOf('/')!= -1)
                    fileName = item.first.substring(item.first.lastIndexOf("/")+1);
                else
                    fileName = item.first;
                String destUrl = resFolderPath;
                if(!item.second.isEmpty()) {
//                  if(new File(item.second).isAbsolute()){
                    if(File.separator.equals(item.second.substring(0,1))){ // Shortcut to check isAbsolute()
                        // Its an absolute url. set the destUrl to empty so that item.second is taken as is
                        destUrl = "";
                    }
                    destUrl = destUrl + item.second + '/';
                }
                destUrl = destUrl + fileName;
                copyFile(item.first, destUrl);
            }
        }
    }
public void copyResourcesToCacheIfRequired1(Activity activity){
        if( ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED )
            return;
        String sigFilePath = resFolderPath + "/sarvamoola/aitareya.txt";
        File sigFile = new File(sigFilePath);
        if(!sigFile.exists())
        {
            for (Pair<String, String> item : mFilesToCopy) {
                String fileName ;
                if(item.first.indexOf('/')!= -1)
                    fileName = item.first.substring(item.first.lastIndexOf("/")+1);
                else
                    fileName = item.first;
                String destUrl = resFolderPath;
                if(!item.second.isEmpty()) {
                    if(File.separator.equals(item.second.substring(0,1))){
                       
                        destUrl = "";
                    }
                    destUrl = destUrl + item.second + '/';
                }
                destUrl = destUrl + fileName;
                copyFile(item.first, destUrl);
            }
        }
    }
public void copyresourcestocacheifrequired1(activity activity){ if( contextcompat.checkselfpermission(activity, manifest.permission.write_external_storage) != packagemanager.permission_granted ) return; string sigfilepath = resfolderpath + "/sarvamoola/aitareya.txt"; file sigfile = new file(sigfilepath); if(!sigfile.exists()) { for (pair<string, string> item : mfilestocopy) { string filename ; if(item.first.indexof('/')!= -1) filename = item.first.substring(item.first.lastindexof("/")+1); else filename = item.first; string desturl = resfolderpath; if(!item.second.isempty()) { if(file.separator.equals(item.second.substring(0,1))){ desturl = ""; } desturl = desturl + item.second + '/'; } desturl = desturl + filename; copyfile(item.first, desturl); } } }