Interface Home

  • All Known Implementing Classes:
    HmBase, HmOptional, HmSave

    public interface Home
    Location for the files.
    Since:
    0.32.0
    • Method Detail

      • save

        void save​(String str,
                  Path path)
           throws IOException
        Saving string.
        Parameters:
        str - String
        path - Cwd-relative path to file
        Throws:
        IOException - If fails
      • save

        void save​(org.cactoos.Text txt,
                  Path path)
           throws IOException
        Saving text.
        Parameters:
        txt - Text
        path - Cwd-relative path to file
        Throws:
        IOException - If fails
      • save

        void save​(InputStream stream,
                  Path path)
           throws IOException
        Saving stream.
        Parameters:
        stream - Input stream
        path - Cwd-relative path to file
        Throws:
        IOException - If fails
      • save

        void save​(byte[] bytes,
                  Path path)
           throws IOException
        Saving bytes.
        Parameters:
        bytes - Byte array
        path - Cwd-relative path to file
        Throws:
        IOException - If fails
      • 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 file
        IllegalArgumentException - 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