namespace Akenti class FileURLHandlerImpl : public URLHandlerImpl

A FileURLHandlerImpl is an object that implements the services for a file URL that are provided by the base class, URLHandlerImpl

Inheritance:


Public Methods

File (const string& filename)
Construct this object
string getName () const
Gets the name of the file
string getAbsolutePath () const
Gets the absolute path of the file
string getParent () const
Gets the Parent directory of the file
bool hasParent () const
Checks to see if the file has parent directory
bool isAbsolute () const
Checks to see if the filename is an absolute path form (i
bool exists () const
Checks to see if the file exists or not
bool isDirectory () const
Checks to see if the file exists and is a directory
bool isFile () const
Checks to see if the file exists and is not a directory
vector list () const
Returns a list of the contents of this directory
vector list (const Filter& filter) const
Returns a list of file names after being filtered
void mkdir () const
Create a directory
bool remove () const
Deletes this file/i>
string paramString () const
Returns a string representation for File which is used for debugging purposes
string toLogString () const
For logging purpose
FileURLHandlerImpl ()
Constructs this object
~FileURLHandlerImpl ()
Destroys this object
URLConnection getURLConnection (const URL& url) const
Creates a new URL connection and returns it

Inherited from URLHandlerImpl:

Public Methods

virtual void parseURL(URL& url, const string& spec) const
virtual void initURL(URL& url, const string& host, int port, const string& file) const
virtual string toExternalForm(const URL& url) const

Protected Methods

void setHost(URL& url, const string& host) const
void setPort(URL &url, int port) const
void setFile(URL& url, const string& file) const

Documentation

A FileURLHandlerImpl is an object that implements the services for a file URL that are provided by the base class, URLHandlerImpl. It initializes a file URL by parsing the a URL string. It creates the URL string from the URL. It creates a URL connection for the file.
File(const string& filename)
Construct this object. If filename starts with "/" it is an absolute pathname, otherwise it is relative to the current working directory.
Parameters:
filename - string name of the file,

string getName() const
Gets the name of the file.
Returns:
name of the file

string getAbsolutePath() const
Gets the absolute path of the file.
Throws:
Error if we cannot determine the working directory.
Returns:
string the absolute path

string getParent() const
Gets the Parent directory of the file. If the filename is a single "/" an empty string is returned. If the name is relative (contains no "/") an empty string is returned.
Returns:
string the parent name of the file

bool hasParent() const
Checks to see if the file has parent directory.
Returns:
bool an indication if the file has a parent or not

bool isAbsolute() const
Checks to see if the filename is an absolute path form (i.e. starts with a "/".
Returns:
bool true if the file is absolute, otherwise false.

bool exists() const
Checks to see if the file exists or not.
Returns:
bool true if the file exists, otherwise false.

bool isDirectory() const
Checks to see if the file exists and is a directory.
Returns:
bool true if the file is a directory, otherwise false.

bool isFile() const
Checks to see if the file exists and is not a directory
Returns:
bool true if the file is not a directory, other false.

vector list() const
Returns a list of the contents of this directory.
Throws:
Error : file does not exist
Error : file is not a directory
IOException : unable to open directory
Returns:
vector list of all the directory entries

vector list(const Filter& filter) const
Returns a list of file names after being filtered.
Throws:
Error if file does not exits or
Error file is not a directory
IOException if unable to open directory
Returns:
vector collection of filtered file name(s)
Parameters:
filter - a pattern that a name must match in order to be included in the returned list of names.

void mkdir() const
Create a directory.
Throws:
Error
IOException

bool remove() const
Deletes this file/i>. A directory File must be empty for this call to succeed.
Returns:
true if succesful false otherwise.

string paramString() const
Returns a string representation for File which is used for debugging purposes.
Returns:
debugging info

string toLogString() const
For logging purpose

FileURLHandlerImpl()
Constructs this object.

~FileURLHandlerImpl()
Destroys this object

URLConnection getURLConnection(const URL& url) const
Creates a new URL connection and returns it.
Returns:
URLConnection a new URL connection
Parameters:
url - The URL to which the connection is going to apply
See Also:
URLConnection(URLConnectionImpl* impl = NULL)
FileURLConnectionImpl(const URL& url)


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/11/01
See Also:
URL
URLConnection

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de