Class Home


  • public final class Home
    extends Object
    Base location for files.
    Since:
    0.27
    • 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 - String
        path - 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 - Text
        path - Cwd-relative path to file
        Throws:
        IOException - If fails
      • save

        public 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

        public void save​(byte[] bytes,
                         Path path)
                  throws IOException
        Saving bytes.
        Parameters:
        bytes - Byte array
        path - 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 - Input
        path - 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
      • absolute

        public Path absolute​(Path path)
        Absolute path to a file.
        Parameters:
        path - Cwd-relative path to file
        Returns:
        Absolute path