Package co.ostorlab.ci.jenkins.utils
Class FileHelper
- java.lang.Object
-
- co.ostorlab.ci.jenkins.utils.FileHelper
-
public class FileHelper extends Object
The type File handler.
-
-
Constructor Summary
Constructors Constructor Description FileHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static File
find(File parent, String name)
Find file in the parent directory provided.static byte[]
load(InputStream in)
Load InputStream to byte [ ].static byte[]
load(String file)
Load byte [ ].static void
save(String path, String contents)
Save a file with String content in the path provided
-
-
-
Method Detail
-
load
public static byte[] load(String file) throws IOException
Load byte [ ].- Parameters:
file
- the file- Returns:
- the byte [ ]
- Throws:
IOException
- the io exception
-
find
public static File find(File parent, String name) throws IOException
Find file in the parent directory provided.- Parameters:
parent
- the parentname
- the name- Returns:
- the file
- Throws:
IOException
- the io exception
-
save
public static void save(String path, String contents) throws IOException
Save a file with String content in the path provided- Parameters:
path
- the pathcontents
- the contents- Throws:
IOException
- the io exception
-
load
public static byte[] load(InputStream in) throws IOException
Load InputStream to byte [ ].- Parameters:
in
- the in- Returns:
- the byte [ ]
- Throws:
IOException
- the io exception
-
-