Search in sources :

Example 1 with ClearcaseXpp3Reader

use of org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader in project maven-scm by apache.

the class ClearCaseUtil method readSettings.

public static Settings readSettings() {
    File settingsFile = new File(settingsDirectory, CLEARCASE_SETTINGS_FILENAME);
    if (!settingsFile.exists()) {
        File scmGlobalDir = new File(System.getProperty("maven.home"), "conf");
        settingsFile = new File(scmGlobalDir, CLEARCASE_SETTINGS_FILENAME);
    }
    if (settingsFile.exists()) {
        ClearcaseXpp3Reader reader = new ClearcaseXpp3Reader();
        try {
            return reader.read(ReaderFactory.newXmlReader(settingsFile));
        } catch (FileNotFoundException e) {
        // nop
        } catch (IOException e) {
        // nop
        } catch (XmlPullParserException e) {
            String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage();
            System.out.println(message);
        }
    }
    return new Settings();
}
Also used : ClearcaseXpp3Reader(org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader) FileNotFoundException(java.io.FileNotFoundException) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException) File(java.io.File) Settings(org.apache.maven.scm.providers.clearcase.settings.Settings)

Aggregations

File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 Settings (org.apache.maven.scm.providers.clearcase.settings.Settings)1 ClearcaseXpp3Reader (org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1