Android CSV file choose from Storage and get its path
<p>I want to import csv from external storage and then update my database but when i am selecting that csv from downloaded folder FileNotFoundExpception comes. Here is the exception System.err: java.io.FileNotFoundException: /document/primary:Download/GuestCSV.csv: open failed: ENOENT (No such file or directory)
 Here is my code. Kindly review my code and help me to find a solution.</p>

<pre><code>            Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.setType("text/*");
            startActivityForResult(Intent.createChooser(intent, "Open CSV"), ACTIVITY_CHOOSE_FILE);


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case ACTIVITY_CHOOSE_FILE: {
            if (resultCode == RESULT_OK) {
                onImport(new File(data.getData().getPath()));
            }
        }
    }
}

public void onImport(File files) {
    try {
        CSVReader reader = new CSVReader(new FileReader(files));
        String[] nextLine;
        try {
            while ((nextLine = reader.readNext()) != null) {

                // nextLine[] is an array of values from the line
                String emailID = nextLine[0];
                String guestName = nextLine[1];
                String guestSource = nextLine[2];
                String guestPhone = nextLine[3];
                String guestCount = nextLine[4];
                String guestCreatedDate = nextLine[5];
                String guestModifiedDate = nextLine[6];
                GuestDetails guestDetails = new GuestDetails();
                guestDetails.setEmail(emailID);
                guestDetails.setUsername(guestName);
                guestDetails.setPhone(guestPhone);
                guestDetails.setSource(guestSource);
                guestDetails.setCount(Integer.valueOf(guestCount));
                guestDetails.setCreatedDate(guestCreatedDate);
                guestDetails.setModifiedDate(guestModifiedDate);
                try {
                    helper.insertGuest(guestDetails);
                } catch (SQLiteConstraintException e) {
                    e.printStackTrace();
                }
                Toast.makeText(getApplicationContext(), "Data inserted into table...", Toast.LENGTH_SHORT).show();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
}
</code></pre>