/webportal/src/main/java/au/org/emii/portal/config/ConfigurationFile.java

http://alageospatialportal.googlecode.com/ · Java · 40 lines · 7 code · 7 blank · 26 comment · 0 complexity · 8fe99deedc815c8e45d5f801feee88ae MD5 · raw file

  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package au.org.emii.portal.config;
  6. /**
  7. *
  8. * @author geoff
  9. */
  10. public interface ConfigurationFile {
  11. /**
  12. * Read and validate the configuration file, then return it as a string
  13. * if it validated.
  14. * @return Contents of config file as string if valid, otherwise null
  15. */
  16. String configurationFileContents();
  17. /**
  18. * Save the content string inside the config file. Make sure you've validated
  19. * the content before attempting to save (use validateConfigFileContents())
  20. * @param content XML string to save as config file contents
  21. * @return true on success, otherwise false
  22. */
  23. boolean saveAsConfigFile(String content);
  24. boolean validateConfigFileContents(String content, boolean quiet);
  25. /**
  26. * Validate contents of config file to schema
  27. *
  28. * File contents must be UTF-8!
  29. * @param content
  30. * @return
  31. */
  32. boolean validateConfigFileContents(String content);
  33. }