Feature Overview
This feature converts files to static resources.
This feature converts files to static resources.
None
public class FileDemo {
public static void main() {
@file(name='beans')
String content = null;
}
}
public class FileDemo {
public static void main() {
String content = Sweet.readFile('beans');
}
}
The source directories and destination directories of the files are controlled by fileSrcDir
and fileDestDir
in the config.
When you need to use a file, you can create one in the file source directory. Sweet.apex will compile it to a static resource.
You need to deploy the static resource to make the code work.
Contribute on Github! Edit this section.