Class FileSystemManager
- java.lang.Object
-
- com.trivago.cluecumber.engine.filesystem.FileSystemManager
-
@Singleton public class FileSystemManager extends Object
-
-
Constructor Summary
Constructors Constructor Description FileSystemManager(CluecumberLogger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyResource(String source, String destination)Copy file to a new location.voidcopyResourceFromJar(String resourceName, String destination)Export a resource embedded into a Jar file to the local file path.voidcreateDirectory(String dirName)Creates a directory if it does not exists.List<Path>getJsonFilePaths(String sourcePath)Return a list of JSON files in a given directory.
-
-
-
Constructor Detail
-
FileSystemManager
@Inject public FileSystemManager(CluecumberLogger logger)
-
-
Method Detail
-
getJsonFilePaths
public List<Path> getJsonFilePaths(String sourcePath)
Return a list of JSON files in a given directory.- Parameters:
sourcePath- The path in which to search for JSON files.- Returns:
- A list of JSON file paths.
-
createDirectory
public void createDirectory(String dirName) throws PathCreationException
Creates a directory if it does not exists.- Parameters:
dirName- Name of directory.- Throws:
PathCreationException
-
copyResourceFromJar
public void copyResourceFromJar(String resourceName, String destination) throws CluecumberException
Export a resource embedded into a Jar file to the local file path.- Parameters:
resourceName- path to the embedded resource.destination- full path to the destination resource.- Throws:
CluecumberException- seeCluecumberException.
-
copyResource
public void copyResource(String source, String destination) throws CluecumberException
Copy file to a new location.- Parameters:
source- The source file.destination- The destination file.- Throws:
CluecumberException- seeCluecumberException.
-
-