| Constructor and Description |
|---|
CommandContextImpl(org.jline.reader.LineReader reader,
String version) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyResource(String source,
Path dest)
Copy a classpath resource to a file.
|
void |
copyResource(String source,
Path dest,
Set<PosixFilePermission> permissions)
Copy a classpath resource to a file.
|
void |
exit(int code)
Exit application.
|
String |
getVersion()
Jooby version to use.
|
Path |
getWorkspace()
Working directory (where the projects are created).
|
void |
println(String message)
Write a message to console.
|
String |
readLine(String prompt)
Ask user for input.
|
void |
setWorkspace(Path workspace)
Set workspace/working directory.
|
void |
writeTemplate(String template,
Object model,
Path file)
Look for the given template and dump/write to the file.
|
public CommandContextImpl(org.jline.reader.LineReader reader,
String version)
throws IOException
IOException@Nonnull public String getVersion()
ContextgetVersion in interface Context@Nonnull public Path getWorkspace()
ContextgetWorkspace in interface Contextpublic void setWorkspace(@Nonnull Path workspace) throws IOException
ContextsetWorkspace in interface Contextworkspace - Workspace/working directory.IOException - When directory doesn't exist.public void exit(int code)
Contextpublic String readLine(String prompt)
Contextpublic void println(String message)
Contextpublic void writeTemplate(String template, Object model, Path file) throws IOException
ContextwriteTemplate in interface Contexttemplate - Template name.model - Template data.file - Output file.IOException - If something goes wrong.public void copyResource(String source, Path dest) throws IOException
ContextcopyResource in interface Contextsource - Resource.dest - Destination file.IOException - If something goes wrong.public void copyResource(String source, Path dest, Set<PosixFilePermission> permissions) throws IOException
ContextcopyResource in interface Contextsource - Resource.dest - Destination file.permissions - File permissions.IOException - If something goes wrong.Copyright © 2019. All rights reserved.