Opening a download file and coping it : I am tryiing to openn a file I demand from mmy user to download so i can use it so i am tryin to copy it to my internal storage
i tried using this code:

        Intent myIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
        myIntent.setType("text/*");
        myIntent.addCategory(Intent.CATEGORY_OPENABLE);
        startActivityForResult(myIntent, 100);


        protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if (requestCode == 100) {
            if(resultCode == Activity.RESULT_OK){
                Uri result= data.getData();
                Log.e("fag", result.getPath());

                copyFile(result);


            }
            if (resultCode == Activity.RESULT_CANCELED) {
                Log.e("", "canceled");
            }
        }
        Intent a = new Intent(getApplicationContext(), MainActivity.class);
        startActivity(a);
        }
    

      private void copyFile(Uri inputFile) {

        FileInputStream in = null;
        FileOutputStream out = null;
        try {
            in = new FileInputStream(inputFile.getPath());
            out = openFileOutput(NAME , MODE_PRIVATE);
            byte[] buffer = new byte[1024];
            while ( in.read(buffer) != -1) {
                out.write(buffer);
            }
            in.close();
            in = null;
            out.close();
            out = null;
        }  catch (FileNotFoundException fnfe1) {
            Log.e("tag", fnfe1.getMessage());
            fnfe1.printStackTrace();
        }
        catch (Exception e) {
            Log.e("tag", e.getMessage());
        }
    }


but when i run this cod i get a file not found exception. so i checked what uri i get drom the intent and it isn't the path to the file but this path 

     /document/primary:Download/5643_05072018-13-48.csv
and i dont know how to use this uri.
I got a simmmilar resualt using the ACTION_GET_CONTENT intent.
can someone show me how to use it?