Package org.eolang.maven.util
Interface Home
-
- All Known Implementing Classes:
HmBase
,HmOptional
,HmSave
public interface Home
Location for the files.- Since:
- 0.32.0
-
-
Method Summary
All Methods Instance Methods Abstract 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.Path
onlyRelative(Path path)
Verifies that given path is relative and throws exception.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.
-
-
-
Method Detail
-
save
void save(String str, Path path) throws IOException
Saving string.- Parameters:
str
- Stringpath
- Cwd-relative path to file- Throws:
IOException
- If fails
-
save
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
void save(InputStream stream, Path path) throws IOException
Saving stream.- Parameters:
stream
- Input streampath
- Cwd-relative path to file- Throws:
IOException
- If fails
-
save
void save(byte[] bytes, Path path) throws IOException
Saving bytes.- Parameters:
bytes
- Byte arraypath
- Cwd-relative path to file- Throws:
IOException
- If fails
-
save
void save(org.cactoos.Input input, Path path) throws IOException
Saving input.- Parameters:
input
- Inputpath
- Cwd-relative path to file- Throws:
IOException
- If failsIllegalArgumentException
- If given path is absolute
-
exists
boolean exists(Path path)
Check if exists.- Parameters:
path
- Cwd-relative path to file- Returns:
- True if exists
- Throws:
IllegalArgumentException
- If given path is absolute
-
load
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 given path is absolute
-
absolute
Path absolute(Path path)
Absolute path to a file.- Parameters:
path
- Cwd-relative path to file- Returns:
- Absolute path
-
onlyRelative
Path onlyRelative(Path path)
Verifies that given path is relative and throws exception.- Parameters:
path
- Path to be verified- Returns:
- Given path if it's relative
- Throws:
IllegalArgumentException
- If given path is Absolute
-
-