Code example for URL

Methods: toString

0
	 */ 
	private RobotItem register(URL classFileUrl, IRepositoryRoot root, IRepository repository) {
		RobotItem item = null;
 
		// Check if the class file is already registered in the repository 
		String friendlyUrl = UrlUtil.removeFileExtension(classFileUrl.toString());
		 
		IRepositoryItem repositoryItem = repository.getItem(friendlyUrl);
		if (repositoryItem instanceof RobotItem) {
			item = (RobotItem) repositoryItem;
		} 
 
		// If the class file has not been registered then create a new RobotItem based on the class file URL 
		if (item == null) {
			item = new RobotItem(classFileUrl, root);
		} 
 
		// Set the class path URL and class URL on the RobotItem 
		item.setClassPathURL(root.getURL());
		item.setClassURL(classFileUrl);
 
		// Add or update the item in the repository and return it 
		repository.addOrUpdateItem(item);
		return item;
	}