Code example for FileReader

Methods: close

0
        } 
    } 
 
    protected void load() throws IOException, JSONException{ 
    	File vocabsFile = new File(workingDir,SAVED_VOCABULARIES_FILE_NAME);
    	FileReader reader = new FileReader(vocabsFile);
        try { 
            JSONTokener tokener = new JSONTokener(reader);
            JSONObject obj = (JSONObject) tokener.nextValue();
            JSONArray prefixes = obj.getJSONArray("prefixes");
            for(int i=0;i<prefixes.length();i++){
            	JSONObject p = prefixes.getJSONObject(i);
            	String name = p.getString("name");
            	String uri = p.getString("uri");
            	this.predefinedVocabulariesMap.put(name,new Vocabulary(name,uri));
            } 
        } finally { 
            reader.close();
        } 
 
    } 
     
    private void write(JSONWriter writer,Properties options) throws JSONException{
Stop searching for code, let great code find you!  Add Codota to your java IDE