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 Path
absolute(Path path)
Absolute path to a file.boolean
exists(Path path)
Check if exists.org.cactoos.Bytes
load(Path path)
Load bytes from file by path.void
save(byte[] bytes, Path path)
Saving bytes.void
save(InputStream stream, Path path)
Saving stream.void
save(String str, Path path)
Saving string.void
save(org.cactoos.Input input, Path path)
Saving input.void
save(org.cactoos.Text txt, Path path)
Saving text.
-
-
-
Constructor Detail
-
Home
public Home()
Ctor.
-
Home
public Home(Path path)
Ctor.- Parameters:
path
- Path
-
-
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 IOException
Saving 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 IOException
Saving 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 IOException
Saving input.- Parameters:
input
- Inputpath
- Cwd-relative path to file- Throws:
IOException
- If fails
-
exists
public boolean exists(Path path)
Check if exists.- Parameters:
path
- Cwd-relative path to file- Returns:
- True if exists
-
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 file
-
-