yes, just have a check of file://. Could be changed like below files if no special handling for other schemes:
if (src.getScheme().equals("file")) {

} else {
}