Code example for Path

Methods: getFileName

0
	} 
 
	private void process(WatchEvent.Kind<Path> kind, Path path){
		ModelRegistry modelRegistry = getModelRegistry();
 
		String id = (path.getFileName()).toString();
 
		// Remove file name extension 
		// Start the search from the beginning of the file name, in case there are multiple extensions 
		int dot = id.indexOf('.');
		if(dot > -1){
			id = id.substring(0, dot);
		} // End if 
 
		if(!ModelRegistry.validateId(id)){
			return; 
		} // End if 
 
		if((StandardWatchEventKinds.ENTRY_CREATE).equals(kind)){
			ModelEvaluator<?> evaluator;
 
			try { 
				InputStream is = Files.newInputStream(path);
 
				try { 
					evaluator = modelRegistry.load(is);
				} finally { 
					is.close();
Contextual code suggestions in your IDE  Get Codota for Java