/** * Validate the parameters specified for task. * * @throws BuildException if fails validation checks */ private void validate() throws BuildException { if (null == m_dir) { m_dir = getProject().getBaseDir(); } if (null == m_output) { final String message = "Destfile must be set."; throw new BuildException(message); } if (!m_dir.exists()) { final String message = "Cannot find base dir " + m_dir.getAbsolutePath(); throw new BuildException(message); } if (null != m_usersFile && !m_usersFile.exists()) { final String message = "Cannot find user lookup list " + m_usersFile.getAbsolutePath(); throw new BuildException(message); } }
/** * Validate the parameters specified for task. * * @throws BuildException if fails validation checks */ private void validate() throws BuildException { if (null == m_dir) { m_dir = getProject().getBaseDir(); } if (null == m_output) { final String message = "Destfile must be set."; throw new BuildException(message); } if (!m_dir.exists()) { final String message = "Cannot find base dir " + m_dir.getAbsolutePath(); throw new BuildException(message); } if (null != m_usersFile && !m_usersFile.exists()) { final String message = "Cannot find user lookup list " + m_usersFile.getAbsolutePath(); throw new BuildException(message); } }
/** * Print changelog to file specified in task. * * @param entrySet the entry set to write. * @throws BuildException if there is an error writing changelog. */ private void writeChangeLog(final CVSEntry[] entrySet) throws BuildException { OutputStream output = null; try { output = m_output; final PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8")); final ChangeLogWriter serializer = new ChangeLogWriter(); serializer.printChangeLog(writer, entrySet); } catch (final UnsupportedEncodingException uee) { getProject().log(uee.toString(), Project.MSG_ERR); } catch (final IOException ioe) { throw new BuildException(ioe.toString(), ioe); } finally { IOUtils.closeQuietly(output); } } }
/** * Print changelog to file specified in task. * * @param entrySet the entry set to write. * @throws BuildException if there is an error writing changelog. */ private void writeChangeLog(final CVSEntry[] entrySet) throws BuildException { OutputStream output = null; try { output = m_output; final PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8")); final ChangeLogWriter serializer = new ChangeLogWriter(); serializer.printChangeLog(writer, entrySet); } catch (final UnsupportedEncodingException uee) { getProject().log(uee.toString(), Project.MSG_ERR); } catch (final IOException ioe) { throw new BuildException(ioe.toString(), ioe); } finally { IOUtils.closeQuietly(output); } } }
myCvsVersion.setProject(getProject()); myCvsVersion.setTaskName("cvsversion"); myCvsVersion.setCvsRoot(getCvsRoot());
myCvsVersion.setProject(getProject()); myCvsVersion.setTaskName("cvsversion"); myCvsVersion.setCvsRoot(getCvsRoot());