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
Opens an output stream for reading the data at the network storage place.- Returns:
- output stream
- Throws:
Exception
-
getInputStream
Opens an input stream for writing the data from the network storage place.- Returns:
- input stream
- Throws:
Exception
-
close
Closes the connection.- Throws:
Exception
-
pwd
Returns the current working directory or the connection.- Returns:
- print working directory
- Throws:
Exception
-
cd
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
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
Deletes the given path.- Parameters:
path
- file or directory path, relative (subdir1/subdir2) or absolute (/root/subdir)- Throws:
Exception
-
mkdir
Creates a new directory.- Parameters:
path
- directory path, relative (subdir1/subdir2) or absolute (/root/subdir)- Throws:
Exception
-
rename
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
-