In local file system, files could be accessed by using URL class. Hence, file opening is an easy task done by URL class, if your code is needed to find out whether file came from local file system or network.
How a file could be opened in local file system by URL class is shown in this example:
URL url = new URL("file:/c:/data/test.txt");
URLConnection urlConnection = url.openConnection();
InputStream input = urlConnection.getInputStream();