Package org.eolang.maven.util
Interface Home
-
- All Known Implementing Classes:
HmBase,HmOptional
public interface HomeLocation for the files.- Since:
- 0.32.0
-
-
Method Summary
All Methods Instance Methods Abstract 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.PathonlyRelative(Path path)Verifies that given path is relative and throws exception.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
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 IOExceptionSaving 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 IOExceptionSaving bytes.- Parameters:
bytes- Byte arraypath- Cwd-relative path to file- Throws:
IOException- If fails
-
save
void save(org.cactoos.Input input, Path path) throws IOExceptionSaving 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
-
-