Package io.quarkus.deployment.util
Class FileUtil
- java.lang.Object
-
- io.quarkus.deployment.util.FileUtil
-
public class FileUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteDirectory(Path directory)
static void
deleteIfExists(Path path)
static byte[]
readFileContents(InputStream inputStream)
static String
translateToVolumePath(String windowsStylePath)
Translates a file path from the Windows Style to a syntax accepted by Docker, so that volumes be safely mounted in both Docker for Windows and the legacy Docker Toolbox.
-
-
-
Method Detail
-
deleteIfExists
public static void deleteIfExists(Path path) throws IOException
- Throws:
IOException
-
deleteDirectory
public static void deleteDirectory(Path directory) throws IOException
- Throws:
IOException
-
readFileContents
public static byte[] readFileContents(InputStream inputStream) throws IOException
- Throws:
IOException
-
translateToVolumePath
public static String translateToVolumePath(String windowsStylePath)
Translates a file path from the Windows Style to a syntax accepted by Docker, so that volumes be safely mounted in both Docker for Windows and the legacy Docker Toolbox.docker run -v //c/foo/bar:/somewhere (...)
You should only use this method on Windows-style paths, and not Unix-style paths.
- Parameters:
windowsStylePath
- A path formatted in Windows-style, e.g. "C:\foo\bar".- Returns:
- A translated path accepted by Docker, e.g. "//c/foo/bar".
-
-