Package org.eolang.maven.util
Class Home
- java.lang.Object
-
- org.eolang.maven.util.Home
-
public final class Home extends Object
Base location for files.- Since:
- 0.27
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pathabsolute(Path path)Absolute path to a file.booleanexists(Path path)Check if exists.org.cactoos.Bytesload(Path path)Load bytes from file by path.voidsave(byte[] bytes, Path path)Saving bytes.voidsave(InputStream stream, Path path)Saving stream.voidsave(String str, Path path)Saving string.voidsave(org.cactoos.Input input, Path path)Saving input.voidsave(org.cactoos.Text txt, Path path)Saving text.
-
-
-
Method Detail
-
save
public void save(String str, Path path) throws IOException
Saving string.- Parameters:
str- Stringpath- Cwd-relative path to file- Throws:
IOException- If fails
-
save
public void save(org.cactoos.Text txt, Path path) throws IOExceptionSaving text.- Parameters:
txt- Textpath- Cwd-relative path to file- Throws:
IOException- If fails
-
save
public void save(InputStream stream, Path path) throws IOException
Saving stream.- Parameters:
stream- Input streampath- Cwd-relative path to file- Throws:
IOException- If fails
-
save
public void save(byte[] bytes, Path path) throws IOExceptionSaving bytes.- Parameters:
bytes- Byte arraypath- Cwd-relative path to file- Throws:
IOException- If fails
-
save
public void save(org.cactoos.Input input, Path path) throws IOExceptionSaving input.- Parameters:
input- Inputpath- Cwd-relative path to file- Throws:
IOException- If failsIllegalArgumentException- If give path is absolute
-
exists
public boolean exists(Path path)
Check if exists.- Parameters:
path- Cwd-relative path to file- Returns:
- True if exists
- Throws:
IllegalArgumentException- If give path is absolute
-
load
public org.cactoos.Bytes load(Path path) throws IOException
Load bytes from file by path.- Parameters:
path- Cwd-relative path to file- Returns:
- Bytes of file
- Throws:
IOException- if method can't find the file by path or if some exception happens during reading the fileIllegalArgumentException- If give path is absolute
-
-