package org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.template;

import java.io.File;
***REMOVED***
import java.util.NoSuchElementException;

import org.gcube.dataanalysis.dataminer.poolmanager.ansible.model.Role;
import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleBridge;
import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleSerializeHelper;

public class CustomRoleManager ***REMOVED***

  private String root;

  public CustomRoleManager() ***REMOVED***

  ***REMOVED***

  public String getRoot() ***REMOVED***
	    String input = AnsibleBridge.class.getClassLoader().getResource("custom").getPath();

    return input;
  ***REMOVED***

  public Role getRole(String roleName) throws NoSuchElementException ***REMOVED***
    File f = new File(this.getRoot(), roleName);
    try ***REMOVED***
      return AnsibleSerializeHelper.deserializeRoleFromFilesystem(f);
    ***REMOVED*** catch (IOException e) ***REMOVED***
***REMOVED***      e.printStackTrace();
      throw new NoSuchElementException("unable to find " + roleName);
    ***REMOVED***
  ***REMOVED***

***REMOVED***
