File confDirectory
src/java/com/splunk/shuttl/server/mbeans/JMXSplunk.java
super(confDirectory);
	private JMXSplunk(String confFilePath) {
		super(confFilePath);
	@Override
	protected String getDefaultConfFileName() {
		return "splunk.xml";

	public static JMXSplunk createWithConfDirectory(File confDirectory) {
		return new JMXSplunk(confDirectory);
private JMXSplunk(File confDirectory)
File confFile
src/java/com/splunk/shuttl/server/mbeans/JMXSplunk.java
return new JMXSplunk(confFile.getAbsolutePath());
JMXSplunk createWithConfFile(File confFile)
src/java/com/splunk/shuttl/server/mbeans/MBeanBase.java
this(getDefaultConfDirectory());
public MBeanBase()
File confDirectory
src/java/com/splunk/shuttl/server/mbeans/MBeanBase.java
this.confFile = new File(confDirectory, getDefaultConfFileName());
		refresh();
public MBeanBase(File confDirectory)
String confFilePath
src/java/com/splunk/shuttl/server/mbeans/MBeanBase.java
this.confFile = new File(confFilePath);
		refresh();
public MBeanBase(String confFilePath)
File confDirectory
src/java/com/splunk/shuttl/server/mbeans/ShuttlArchiver.java
super(confDirectory);
	/**
	 * Used for testing and needs to be a String instead of a File, because the
	 * File constructor is already taken.
	 */
	private ShuttlArchiver(String confFilePath) {
		super(confFilePath);
	@Override
	protected String getDefaultConfFileName() {
		return "archiver.xml";
	public static ShuttlArchiver createWithConfDirectory(File confDirectory) {
		return new ShuttlArchiver(confDirectory);
private ShuttlArchiver(File confDirectory)
File confFile
src/java/com/splunk/shuttl/server/mbeans/ShuttlArchiver.java
return new ShuttlArchiver(confFile.getAbsolutePath());
ShuttlArchiver createWithConfFile(File confFile)
src/java/com/splunk/shuttl/server/mbeans/ShuttlServer.java
super();
	public ShuttlServer(File confDirectory) {
		super(confDirectory);
public ShuttlServer()

			String shuttlConfDirPath
test/java/com/splunk/shuttl/FileSystemCleaner.java
cleanConfiguredLocalFileSystemPaths(new File(shuttlConfDirPath));
	public void cleanConfiguredLocalFileSystemPaths(File confsDir) {
		if (confsDir.exists()) {
			TUtilsMBean.runWithRegisteredMBeans(confsDir, new Runnable() {
				@Override
				public void run() {
					FileUtils.deleteQuietly(LocalFileSystemPaths.create()
							.getArchiverDirectory());
void cleanFileSystemFromCreatedFilesDuringTests(
			String shuttlConfDirPath)
String shuttlConfsDirPath
test/java/com/splunk/shuttl/archiver/LocalFileSystemPathsWithRealConfTest.java
File confsDir = new File(shuttlConfsDirPath);
		TUtilsMBean.runWithRegisteredMBeans(confsDir, new Runnable() {
	@Test(groups = { "end-to-end"
void setUp(String shuttlConfsDirPath)
src/java/com/splunk/shuttl/server/mbeans/JMXSplunk.java
return "splunk.xml";
	/**
	 * @param confFile
	 */
	public JMXSplunk(File confFile) {
		this.confFile = confFile.getAbsolutePath();
		callRefreshWithErrorHandling();
	private void callRefreshWithErrorHandling() {
		try {
			refresh();
String getConfFileName()
src/java/com/splunk/shuttl/server/mbeans/JMXSplunk.java
return confFile;
String getPathToXmlFile()
src/java/com/splunk/shuttl/server/mbeans/MBeanBase.java
return System.getenv("SPLUNK_HOME") + File.separator + CONFIGURATION_PATH
				+ getConfFileName();
	public void save() throws ShuttlMBeanException {
			JAXBUtils.save(getConfClass(), getConfObject(), getPathToXmlFile());
	public void refresh() throws ShuttlMBeanException {
			T conf = (T) JAXBUtils.refresh(getConfClass(), getPathToXmlFile());
	protected abstract String getConfFileName();

	/**
	 * Implement this method by looking at {@link ShuttlArchiver
String getPathToDefaultConfFile()
src/java/com/splunk/shuttl/server/mbeans/ShuttlArchiver.java
return "archiver.xml";
	// used by tests
	public ShuttlArchiver(String confFilePath) throws ShuttlMBeanException {
		this.xmlFilePath = confFilePath;
		refreshWithConf();
	private void refreshWithConf() {
		try {
			refresh();
String getConfFileName()
src/java/com/splunk/shuttl/server/mbeans/ShuttlArchiver.java
return this.xmlFilePath;
String getPathToXmlFile()
src/java/com/splunk/shuttl/server/mbeans/ShuttlServer.java
return "server.xml";
	// this signature used by tests
	public ShuttlServer(String confFilePath) throws ShuttlMBeanException {
		try {
			this.xmlFilePath = confFilePath;
			refresh();
String getConfFileName()
src/java/com/splunk/shuttl/server/mbeans/ShuttlServer.java
return xmlFilePath;
String getPathToXmlFile()
test/java/com/splunk/shuttl/FileSystemCleaner.java
cleanConfiguredLocalFileSystemPaths();
	public void cleanConfiguredLocalFileSystemPaths() {
		TUtilsMBean.runWithRegisteredMBeans(new Runnable() {
			@Override
			public void run() {
				FileUtils.deleteQuietly(LocalFileSystemPaths.create()
						.getArchiverDirectory());
void cleanFileSystemFromCreatedFilesDuringTests()
test/java/com/splunk/shuttl/archiver/LocalFileSystemPathsWithRealConfTest.java
TUtilsMBean.runWithRegisteredMBeans(new Runnable() {
	@Test(groups = { "slow-unit"
void setUp()