@Test public void testRelativePathWithSourceSpecified() throws Exception { String[] ids = {"id"}; String[] dataRootPaths = new String[ids.length]; String source = folder.newFile("config.xml").getParent(); DataDirsConfigImpl dataRootConfig = configureDataRoot(ids, dataRootPaths, source); assertThat(dataRootConfig.getRoot(ids[0]).getParent(), is(Paths.get(source))); }
Path getRoot(String identifier) { if (identifier == null) { throw new NullPointerException("Data directory name is null"); } if (!dataRootMap.containsKey(identifier)) { throw new IllegalArgumentException(String.format("Data directory with name: %s is not present in server's configuration", identifier)); } return dataRootMap.get(identifier); }
DataDirsConfigImpl implements DataDirsConfig, ManageableServerComponent, StateDumpable { Path getRoot(String identifier) { if (identifier == null) { throw new NullPointerException("Data directory name is null"); } if (!dataRootMap.containsKey(identifier)) { throw new IllegalArgumentException(String.format("Data directory with name: %s is not present in server's configuration", identifier)); } return dataRootMap.get(identifier); } }
DataDirsConfigImpl implements DataDirsConfig, ManageableServerComponent, StateDumpable { Path getRoot(String identifier) { if (identifier == null) { throw new NullPointerException("Data directory name is null"); } if (!dataRootMap.containsKey(identifier)) { throw new IllegalArgumentException(String.format("Data directory with name: %s is not present in server's configuration", identifier)); } return dataRootMap.get(identifier); } DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, Path metadataDir, Map<String, Path> dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories, boolean skipIO); }
DataDirsConfigImpl implements DataDirsConfig, ManageableServerComponent, StateDumpable { Path getRoot(String identifier) { if (identifier == null) { throw new NullPointerException("Data directory name is null"); } if (!dataRootMap.containsKey(identifier)) { throw new IllegalArgumentException(String.format("Data directory with name: %s is not present in server's configuration", identifier)); } return dataRootMap.get(identifier); } DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, Path metadataDir, Map<String, Path> dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories, boolean skipIO); @Override DataDirs getDataDirectoriesForServer(PlatformConfiguration platformConfiguration); @Override void addDataDirectory(String name, String path); void addDataDirectory(String name, String path, boolean skipIO); @Override void validateDataDirectory(String name, String path); void validateDataDirectory(String name, String path, boolean skipIO); @Override void onManagementRegistryCreated(EntityManagementRegistry registry); @Override void onManagementRegistryClose(EntityManagementRegistry registry); @Override void addStateTo(StateDumpCollector dump); @Override void close(); long getDiskUsageByRootIdentifier(String identifier); }
DataDirsConfigImpl implements DataDirsConfig, ManageableServerComponent, StateDumpable { Path getRoot(String identifier) { if (identifier == null) { throw new NullPointerException("Data directory name is null"); } if (!dataRootMap.containsKey(identifier)) { throw new IllegalArgumentException(String.format("Data directory with name: %s is not present in server's configuration", identifier)); } return dataRootMap.get(identifier); } DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, Path metadataDir, Map<String, Path> dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories);  DataDirsConfigImpl(IParameterSubstitutor parameterSubstitutor, PathResolver pathResolver, org.terracotta.data.config.DataDirectories dataDirectories, boolean skipIO); @Override DataDirs getDataDirectoriesForServer(PlatformConfiguration platformConfiguration); @Override void addDataDirectory(String name, String path); void addDataDirectory(String name, String path, boolean skipIO); @Override void validateDataDirectory(String name, String path); void validateDataDirectory(String name, String path, boolean skipIO); @Override void onManagementRegistryCreated(EntityManagementRegistry registry); @Override void onManagementRegistryClose(EntityManagementRegistry registry); @Override void addStateTo(StateDumpCollector dump); @Override void close(); long getDiskUsageByRootIdentifier(String identifier);  }