code: private FileSystem getFileSystemSafe() throws IOException
      {
          try {
              fs.getFileStatus(new Path("/"));
              return fs;
          }
          catch (NullPointerException e) {
              throw new IOException("file system not initialized");
          }
      }
docs: throws an IOException if the current FileSystem isn't working