Package dev.galasa.artifact
Interface IBundleResources
public interface IBundleResources
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionretrieveDirectoryContents
(String directory) For a directory, retrieve a map of file paths within it, and InputStreams for those files.retrieveFile
(String path) Retrieve a single file as an InputStreamretrieveFileAsString
(String path) Retrieve the contents of a file as a StringretrieveJar
(String symbolicName, String version, String directory) Retrieve a jar file as an input streamretrieveSkeletonDirectoryContents
(String directory, Map<String, Object> parameters, int skeletonType) For a directory, retrieve a map of file paths within it, and InputStreams for those files, if the file is a skeleton then any required substitutions will be performed before the stream is returned.retrieveSkeletonFile
(String path, Map<String, Object> parameters) Retrieve a single file as an InputStream If the file is a skeleton then any required substitutions will be performed before the stream is returned.retrieveSkeletonFile
(String path, Map<String, Object> parameters, int skeletonType) Retrieve a single file as an InputStream, if the file is a skeleton then any required substitutions will be performed before the stream is returned.retrieveSkeletonFileAsString
(String path, Map<String, Object> parameters) Retrieve a single file as a String If the file is a skeleton then any required substitutions will be performed before the string is returned.streamAsList
(InputStream file) Convert an input stream into a list of stringsstreamAsString
(InputStream file) Convert an input stream into a stringzipDirectoryContents
(String resourcesDirectory, Map<String, Object> parameters, String encoding, boolean gzip)
-
Field Details
-
RESOURCES_DIRECTORY
- See Also:
-
-
Method Details
-
retrieveFile
Retrieve a single file as an InputStream- Parameters:
path
-- Returns:
- Throws:
TestBundleResourceException
-
retrieveFileAsString
Retrieve the contents of a file as a String- Parameters:
path
- The path to the file to which will be read- Returns:
- The contents of the file
- Throws:
TestBundleResourceException
IOException
-
retrieveSkeletonFile
InputStream retrieveSkeletonFile(String path, Map<String, Object> parameters, int skeletonType) throws TestBundleResourceExceptionRetrieve a single file as an InputStream, if the file is a skeleton then any required substitutions will be performed before the stream is returned.- Parameters:
path
-parameters
-skeletonType
-- Returns:
- Throws:
TestBundleResourceException
-
retrieveSkeletonFile
InputStream retrieveSkeletonFile(String path, Map<String, Object> parameters) throws TestBundleResourceExceptionRetrieve a single file as an InputStream If the file is a skeleton then any required substitutions will be performed before the stream is returned. Uses the defaultISkeletonProcessor
- Parameters:
path
- The path to the fileparameters
-- Returns:
- A stream so the caller can read the contents of the file
- Throws:
TestBundleResourceException
-
retrieveSkeletonFileAsString
String retrieveSkeletonFileAsString(String path, Map<String, Object> parameters) throws TestBundleResourceException, IOExceptionRetrieve a single file as a String If the file is a skeleton then any required substitutions will be performed before the string is returned. Uses the defaultISkeletonProcessor
- Parameters:
path
- The path to the file to be readparameters
-- Returns:
- The contents of the file
- Throws:
TestBundleResourceException
IOException
-
retrieveDirectoryContents
Map<String,InputStream> retrieveDirectoryContents(String directory) throws TestBundleResourceException For a directory, retrieve a map of file paths within it, and InputStreams for those files.- Parameters:
directory
-- Returns:
- Throws:
TestBundleResourceException
-
retrieveSkeletonDirectoryContents
Map<String,InputStream> retrieveSkeletonDirectoryContents(String directory, Map<String, Object> parameters, int skeletonType) throws TestBundleResourceExceptionFor a directory, retrieve a map of file paths within it, and InputStreams for those files, if the file is a skeleton then any required substitutions will be performed before the stream is returned.- Parameters:
directory
-- Returns:
- Throws:
TestBundleResourceException
-
retrieveJar
InputStream retrieveJar(String symbolicName, String version, String directory) throws TestBundleResourceException Retrieve a jar file as an input stream- Parameters:
symbolicName
-version
-directory
-- Returns:
- Throws:
TestBundleResourceException
-
streamAsList
Convert an input stream into a list of strings- Parameters:
file
-- Returns:
- Throws:
IOException
-
streamAsString
Convert an input stream into a string- Parameters:
file
-- Returns:
- Throws:
IOException
-
zipDirectoryContents
InputStream zipDirectoryContents(String resourcesDirectory, Map<String, Object> parameters, String encoding, boolean gzip) throws TestBundleResourceException- Throws:
TestBundleResourceException
-