ProfilesRoot profilesRoot = new ProfilesRoot(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
/** * @deprecated use the XAM-based model for editing the profiles file, * see org.netbeans.modules.maven.profile package * * @param projectDir * @return */ public @Deprecated static ProfilesRoot createProfilesModel(FileObject projectDir) { FileObject profiles = projectDir.getFileObject("profiles.xml"); ProfilesRoot prof = null; if (profiles != null) { InputStreamReader read = null; try { read = new InputStreamReader(profiles.getInputStream()); prof = new ProfilesXpp3Reader().read(read); } catch (IOException ex) { ex.printStackTrace(); } catch (XmlPullParserException ex) { ex.printStackTrace(); } finally { IOUtil.close(read); } } if (prof == null) { prof = new ProfilesRoot(); } return prof; }
public static ProfilesRoot createProfilesModel(FileObject projectDir) { FileObject profiles = projectDir.getFileObject("profiles.xml"); ProfilesRoot prof = null; if (profiles != null) { InputStreamReader read = null; try { read = new InputStreamReader(profiles.getInputStream()); prof = new ProfilesXpp3Reader().read(read); } catch (IOException ex) { ex.printStackTrace(); } catch (XmlPullParserException ex) { ex.printStackTrace(); } finally { IOUtil.close(read); } } if (prof == null) { prof = new ProfilesRoot(); } return prof; }