Loading...

velocity-dev@jakarta.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

[jira] Updated: (TEXEN-13) Generator.parse fails, if the outputfile points to a directory, that does not exist. Sebastian Zarnekow (JIRA) Fri Oct 05 00:05:04 2007

     [ 
https://issues.apache.org/jira/browse/TEXEN-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebastian Zarnekow updated TEXEN-13:
------------------------------------

    Description: 
The Texentask generates the outputdirectory, if it does not exist, but the 
Generator-Implementation lacks this feature for control templates like the 
following:

# control.vm
$generator.parse("myTemplate.vm", "subdirectory/myTemplate.out")

So either allow subclasses of TexenTask to use another Generator (1), or change 
the implementation of getWriter to allow the Generator to create absent 
directories(2).

(1)
line 486:
Generator generator = createGenerator();

protected Generator createGenerator() {
  return Generator.getInstance();
}

(2)
public Writer getWriter(final String path, final String encoding) throws 
Exception {
  final File f = new File(path).getParentFile();
  if (!f.exists()) {
    f.mkdirs();
  }
  ..
}

  was:
The Texentask generates the outputdirectory, if it does not exist, but the 
Generator-Implementation lacks this feature for control templates like the 
following:

# control.vm
$generator.parse("myTemplate.vm", "subdirectory/myTemplate.out")

So either allow subclasses of TexenTask to use another Generator (1), or change 
the implementation of getWriter to allow the Generator to create absent (2).

(1)
line 486:
Generator generator = createGenerator();

protected Generator createGenerator() {
  return Generator.getInstance();
}

(2)
public Writer getWriter(final String path, final String encoding) throws 
Exception {
  final File f = new File(path).getParentFile();
  if (!f.exists()) {
    f.mkdirs();
  }
  ..
}


> Generator.parse fails, if the outputfile points to a directory, that does not 
> exist.
> ------------------------------------------------------------------------------------
>
>                 Key: TEXEN-13
>                 URL: https://issues.apache.org/jira/browse/TEXEN-13
>             Project: Texen
>          Issue Type: Bug
>            Reporter: Sebastian Zarnekow
>
> The Texentask generates the outputdirectory, if it does not exist, but the 
> Generator-Implementation lacks this feature for control templates like the 
> following:
> # control.vm
> $generator.parse("myTemplate.vm", "subdirectory/myTemplate.out")
> So either allow subclasses of TexenTask to use another Generator (1), or 
> change the implementation of getWriter to allow the Generator to create 
> absent directories(2).
> (1)
> line 486:
> Generator generator = createGenerator();
> protected Generator createGenerator() {
>   return Generator.getInstance();
> }
> (2)
> public Writer getWriter(final String path, final String encoding) throws 
> Exception {
>   final File f = new File(path).getParentFile();
>   if (!f.exists()) {
>     f.mkdirs();
>   }
>   ..
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]