Module omix.api

Interface URLConnectionInterface


public interface URLConnectionInterface
This interface represents the network communication manager for a certain protocol.
Since:
Omix 1.3.11
Author:
Dr. Peter Droste, Omix Visualization
  • Method Summary

    Modifier and Type Method Description
    boolean canInput()
    Determines if the URL connection allows to open an input stream for writing the data from the network storage place.
    boolean canNavigate()
    Determines if the URL connection allows to use the file system navigation methods: pwd() cd(String) ls(String) rm(String) mkdir(String) rename(String, String)
    boolean canOutput()
    Determines if the URL connection allows to open an output stream for reading the data at the network storage place.
    void cd​(String path)
    Changes the current working directory or the connection to the given relative or absolute path.
    void close()
    Closes the connection.
    InputStream getInputStream()
    Opens an input stream for writing the data from the network storage place.
    OutputStream getOutputStream()
    Opens an output stream for reading the data at the network storage place.
    List<String> ls​(String path)
    Lists the content of the directory at the given path.
    void mkdir​(String path)
    Creates a new directory.
    String pwd()
    Returns the current working directory or the connection.
    void rename​(String oldpath, String newpath)
    Renames a file or directory.
    void rm​(String path)
    Deletes the given path.
  • Method Details

    • canNavigate

      boolean canNavigate()
      Determines if the URL connection allows to use the file system navigation methods:
      Returns:
      if connection allows file system navigation
    • canInput

      boolean canInput()
      Determines if the URL connection allows to open an input stream for writing the data from the network storage place.
      Returns:
      if connection allows input streams
    • canOutput

      boolean canOutput()
      Determines if the URL connection allows to open an output stream for reading the data at the network storage place.
      Returns:
      if connection allows output streams
    • getOutputStream

      OutputStream getOutputStream() throws Exception
      Opens an output stream for reading the data at the network storage place.
      Returns:
      output stream
      Throws:
      Exception
    • getInputStream

      InputStream getInputStream() throws Exception
      Opens an input stream for writing the data from the network storage place.
      Returns:
      input stream
      Throws:
      Exception
    • close

      void close() throws Exception
      Closes the connection.
      Throws:
      Exception
    • pwd

      String pwd() throws Exception
      Returns the current working directory or the connection.
      Returns:
      print working directory
      Throws:
      Exception
    • cd

      void cd​(String path) throws Exception
      Changes the current working directory or the connection to the given relative or absolute path.
      Parameters:
      path - directory path, relative (subdir1/subdir2) or absolute (/root/subdir)
      Throws:
      Exception
    • ls

      List<String> ls​(String path) throws Exception
      Lists the content of the directory at the given path.
      Parameters:
      path - directory path, relative (subdir1/subdir2) or absolute (/root/subdir)
      Returns:
      list of content
      Throws:
      Exception
    • rm

      void rm​(String path) throws Exception
      Deletes the given path.
      Parameters:
      path - file or directory path, relative (subdir1/subdir2) or absolute (/root/subdir)
      Throws:
      Exception
    • mkdir

      void mkdir​(String path) throws Exception
      Creates a new directory.
      Parameters:
      path - directory path, relative (subdir1/subdir2) or absolute (/root/subdir)
      Throws:
      Exception
    • rename

      void rename​(String oldpath, String newpath) throws Exception
      Renames a file or directory.
      Parameters:
      oldpath - file path, relative (subdir1/subdir2) or absolute (/root/subdir)
      newpath - file path, relative (subdir1/subdir2) or absolute (/root/subdir)
      Throws:
      Exception