code: public void loadFromResource(String resource, Candidate.CandidateType type) throws IOException {
        InputStream candidatesConfig = classloader.getResourceAsStream(resource);
        if(candidatesConfig == null) {
           throw new IOException("Resource '" + resource + "' not found");
        }
        try {
           loadFrom(candidatesConfig, type);
        }
        finally {
           candidatesConfig.close();
        }
     }
docs: Load a candidate property file
  
  @param resource File name
  @param type Type of the candidate loaded from the stream
  @throws IOException If there's problem reading the file