public class InMemoryMojoReaderBackend extends MojoReaderBackend
The backend serves MOJO content from in memory file system.
DEFAULT_BASE_DIR, DEFAULT_PROTO_PIPELINE_FILE_PATH, DEFAULT_PROTO_PIPELINE_FILENAME, DEFAULT_TOML_PIPELINE_FILE_PATH, DEFAULT_TOML_PIPELINE_FILENAME
Constructor and Description |
---|
InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent) |
InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent,
java.lang.String baseDir) |
InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent,
java.lang.String baseDir,
java.lang.String separator) |
InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent,
java.lang.String baseDir,
java.lang.String separator,
java.lang.String pipelineFileName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static InMemoryMojoReaderBackend |
createFrom(java.io.InputStream inputStream) |
boolean |
exists(java.lang.String filename) |
byte[] |
getBinaryFile(java.lang.String filename)
Retrieve binary content inside the mojo, as a
byte[] array. |
java.lang.String[] |
getDirectoryNames(java.lang.String path)
Retrieve a list of all directory names located in
path , relative to the base directory |
java.io.InputStream |
getFile(java.lang.String filename)
Retrieve content inside the mojo, as a
InputStream . |
java.lang.String[] |
getFileNames(java.lang.String path)
Retrieve a list of all file names located in
path , relative to the base directory |
java.io.BufferedReader |
getTextFile(java.lang.String filename)
Retrieve text content inside the mojo, as a
BufferedReader . |
getBaseDir, getPipelineFile, getPipelineFileName, getSeparator
public InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent)
public InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent, java.lang.String baseDir)
public InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent, java.lang.String baseDir, java.lang.String separator)
public InMemoryMojoReaderBackend(java.util.Map<java.lang.String,byte[]> mojoContent, java.lang.String baseDir, java.lang.String separator, java.lang.String pipelineFileName)
public java.io.InputStream getFile(java.lang.String filename) throws java.io.IOException
MojoReaderBackend
Retrieve content inside the mojo, as a InputStream
.
getFile
in class MojoReaderBackend
java.io.IOException
public java.io.BufferedReader getTextFile(java.lang.String filename) throws java.io.IOException
MojoReaderBackend
Retrieve text content inside the mojo, as a BufferedReader
.
getTextFile
in class MojoReaderBackend
java.io.IOException
public byte[] getBinaryFile(java.lang.String filename)
MojoReaderBackend
Retrieve binary content inside the mojo, as a byte[]
array.
getBinaryFile
in class MojoReaderBackend
public java.lang.String[] getFileNames(java.lang.String path)
MojoReaderBackend
Retrieve a list of all file names located in path
, relative to the base directory
getFileNames
in class MojoReaderBackend
public java.lang.String[] getDirectoryNames(java.lang.String path)
MojoReaderBackend
Retrieve a list of all directory names located in path
, relative to the base directory
getDirectoryNames
in class MojoReaderBackend
public boolean exists(java.lang.String filename)
exists
in class MojoReaderBackend
public void close()
public static InMemoryMojoReaderBackend createFrom(java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException