Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse JET Guide
Previous Page Home Next Page


Standard JET2 Workspace Tags


Create or write an Eclipse workspace file. If the file does not exist, the tag attempts to create it and any containing folders. An error occurs if the file does not exist and cannot be created.

Note that the actual creation of the workspace file is deferred until the JET2Context passed to the executing template has the 'commit' method calls. If the template is part of a JET2 transformation, this occurs once all templates have executed.

If the 'file' tag is contained directly or indirectly by a 'folder' or 'project' tag AND the 'path' attribute on this tag is relative (does not start with a '/'), then the 'path' attribute is treated as relative to the containing 'folder' or 'project'.

An absolute 'path' (one starting with '/') is treated as a workspace relative path. That is, the first component after the slash is interpreted as the name of an Eclipse Project, and subsequence segments are treated as folder names, with the last segment being interpreted as the file name.

When executing, this tag will cause the implicit creation of any folders containing the folder to be created. It will not implicitly create a containing workspace project.

Tag Summary
required <ws:file path="value" template="value"/>
full tag <ws:file path="value" template="value" encoding="value" replace="value" derived="value"/>

Required Attributes
A relative path (no initial '/') or an absolute path.
A project-relative path of a JET template to execute. The template provides the file's contents.

Optional Attributes
The character encoding of the file. If omitted, then the Eclipse workspace determines the encoding. If provided, then the encoding is changed to the specified value. A value of '#default' restores the encoding of the file to the workspace determined default.
A boolean ('true' or 'false') value. If 'true', the tag will overwrite an existing file, otherwise it will not. If omitted, a value of 'true' is assumed.
A boolean value ('true' or 'false') determining the value of the workspace 'derived' attribute for the file. If omitted, a value of 'false' is assumed.

<%-- write a file about.html to myProject after evaluating template about.html.jet--%>
<ws:file path="myProject/about.html" template="templates/about.html.jet"/>

<%-- alternative way of doing the about--%>
<ws:project name="myProject">
  <ws:file path="about.html" template="templates/about.html.jet"/>
  ... other ws:file tags writing to the same project ...

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire