classes/phing/tasks/system/AppendTask/TextElement.php
public function setFile(PhingFile $file)
    {
        // non-existing files are not allowed
        if (!$file->exists()) {
            throw new BuildException("File " . $file . " does not exist.");
        }

        $reader = null;
        try {
            if ($this->encoding == null) {
                $reader = new BufferedReader(new FileReader($file));
            } else {
                $reader = new BufferedReader(
                    new InputStreamReader(new FileInputStream($file))
                );
            }
            $this->value = $reader->read();
        } catch (IOException $ex) {
            $reader->close();
            throw new BuildException($ex);
        }
        $reader->close();
    }
public function setFile(PhingFile $file)
    {
        // non-existing files are not allowed
        if (!$file->exists()) {
            throw new BuildException("File " . $file . " does not exist.");
        }

        $reader = null;
        try {
            if ($this->encoding == null) {
                $reader = new BufferedReader(new FileReader($file));
            } else {
                $reader = new BufferedReader(
                    new InputStreamReader(new FileInputStream($file))
                );
            }
            $this->value = $reader->read();
        } catch (IOException $ex) {
            $reader->close();
            throw new BuildException($ex);
        }
        $reader->close();
    }
public function setFile ( PhingFile $ file ) { // non-existing files are not allowed if ( ! $ file -> exists ( ) ) { throw new BuildException ( "File " . $ file . " does not exist." ) ; } $ reader = null ; try { if ( $ this -> encoding == null ) { $ reader = new BufferedReader ( new FileReader ( $ file ) ) ; } else { $ reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( $ file ) ) ) ; } $ this -> value = $ reader -> read ( ) ; } catch ( IOException $ ex ) { $ reader -> close ( ) ; throw new BuildException ( $ ex ) ; } $ reader -> close ( ) ; }
set the text using a file

@param  PhingFile $file the file to use
@throws BuildException if the file does not exist, or cannot be
read
set the text using a file