\section{KIO::Net\-Access$<$ T, K $>$ Class Template Reference}
\label{classKIO_1_1NetAccess}\index{KIO::NetAccess@{KIO::NetAccess}}
Net Transparency. Provides an easy, synchronous interface to {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} file operations.  


{\tt \#include $<$netaccess.h$>$}

Inheritance diagram for KIO::Net\-Access$<$ T, K $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=79pt]{classKIO_1_1NetAccess__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KIO::Net\-Access$<$ T, K $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=193pt]{classKIO_1_1NetAccess__coll__graph}
\end{center}
\end{figure}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static bool {\bf download} (const {\bf KURL} \&src, {\bf QString} \&target, {\bf QWidget} $\ast$window)
\item 
static bool {\bf download} (const {\bf KURL} \&src, {\bf QString} \&target) KDE\_\-DEPRECATED
\item 
static void {\bf remove\-Temp\-File} (const {\bf QString} \&{\bf name})
\item 
static bool {\bf upload} (const {\bf QString} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window)
\item 
static bool {\bf upload} (const {\bf QString} \&src, const {\bf KURL} \&target) KDE\_\-DEPRECATED
\item 
static bool {\bf copy} (const {\bf KURL} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window)
\item 
static bool {\bf copy} (const {\bf KURL} \&src, const {\bf KURL} \&target) KDE\_\-DEPRECATED
\item 
static bool {\bf file\_\-copy} (const {\bf KURL} \&src, const {\bf KURL} \&dest, int permissions=-1, bool overwrite=false, bool resume=false, {\bf QWidget} $\ast$window=0L)
\item 
static bool {\bf file\_\-move} (const {\bf KURL} \&src, const {\bf KURL} \&target, int permissions=-1, bool overwrite=false, bool resume=false, {\bf QWidget} $\ast$window=0L)
\item 
static bool {\bf dircopy} (const {\bf KURL} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window)
\item 
static bool {\bf dircopy} (const {\bf KURL} \&src, const {\bf KURL} \&target) KDE\_\-DEPRECATED
\item 
static bool {\bf dircopy} (const {\bf KURL::List} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window=0L)
\item 
static bool {\bf move} (const {\bf KURL} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window=0L)
\item 
static bool {\bf move} (const {\bf KURL::List} \&src, const {\bf KURL} \&target, {\bf QWidget} $\ast$window=0L)
\item 
static bool {\bf exists} (const {\bf KURL} \&url, bool source, {\bf QWidget} $\ast$window)
\item 
static bool {\bf exists} (const {\bf KURL} \&url, {\bf QWidget} $\ast$window) KDE\_\-DEPRECATED
\item 
static bool {\bf exists} (const {\bf KURL} \&url) KDE\_\-DEPRECATED
\item 
static bool {\bf exists} (const {\bf KURL} \&url, bool source) KDE\_\-DEPRECATED
\item 
static bool {\bf stat} (const {\bf KURL} \&url, {\bf KIO::UDSEntry} \&entry, {\bf QWidget} $\ast$window)
\item 
static bool {\bf stat} (const {\bf KURL} \&url, {\bf KIO::UDSEntry} \&entry) KDE\_\-DEPRECATED
\item 
static bool {\bf del} (const {\bf KURL} \&url, {\bf QWidget} $\ast$window)
\item 
static bool {\bf del} (const {\bf KURL} \&url) KDE\_\-DEPRECATED
\item 
static bool {\bf mkdir} (const {\bf KURL} \&url, {\bf QWidget} $\ast$window, int permissions=-1)
\item 
static bool {\bf mkdir} (const {\bf KURL} \&url, int permissions=-1) KDE\_\-DEPRECATED
\item 
static {\bf QString} {\bf fish\_\-execute} (const {\bf KURL} \&url, const {\bf QString} command, {\bf QWidget} $\ast$window)
\item 
static bool {\bf synchronous\-Run} ({\bf Job} $\ast$job, {\bf QWidget} $\ast$window, {\bf QByte\-Array} $\ast$data=0, {\bf KURL} $\ast$final\-URL=0, {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ $\ast$meta\-Data=0)
\item 
static {\bf QString} {\bf mimetype} (const {\bf KURL} \&url, {\bf QWidget} $\ast$window)\label{classKIO_1_1NetAccess_e26}

\item 
static {\bf QString} {\bf mimetype} (const {\bf KURL} \&url) KDE\_\-DEPRECATED
\item 
static {\bf QString} {\bf last\-Error\-String} ()
\item 
static int {\bf last\-Error} ()
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf I\_\-like\_\-this\_\-class}\label{classKIO_1_1NetAccess_n0}

\end{CompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename T, typename K$>$ class KIO::Net\-Access$<$ T, K $>$}

Net Transparency. Provides an easy, synchronous interface to {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} file operations. 

{\bf Net\-Access}{\rm (p.\,\pageref{classKIO_1_1NetAccess})} allows you to do simple file operation (load, save, copy, delete...) without working with {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} directly. Whereas a {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} is asynchronous, meaning that the developer has to connect slots for it, KIO::Net\-Access provides synchronous downloads and uploads, as well as temporary file creation and removal. The functions appear to be blocking, but the {\bf Qt} event loop continues running while the operations are handled. This means that the GUI will not freeze.

This class isn't meant to be used as a class but only as a simple namespace for static functions, though an instance of the class is built for internal purposes.

Port to kio done by David Faure, {\tt faure@kde.org}



Definition at line 59 of file netaccess.h.

\subsection{Member Function Documentation}
\index{KIO::NetAccess@{KIO::Net\-Access}!download@{download}}
\index{download@{download}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::download (const {\bf KURL} \& {\em src}, {\bf QString} \& {\em target}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e0}


Downloads a file from an arbitrary URL ({\tt src}) to a temporary file on the local filesystem ({\tt target}). 

If the argument for {\tt target} is an empty string, download will generate a unique temporary filename in /tmp. Since {\tt target} is a reference to {\bf QString} you can access this filename easily. Download will return true if the download was successful, otherwise false.

Special case: If the URL is of kind {\tt file:,} then no downloading is processed but the full filename is returned in {\tt target}. That means you {\em have\/} to take care about the {\tt target} argument. (This is very easy to do, please see the example below.)

Download is synchronous. That means you can use it like this, (assuming {\tt u} is a string which represents a URL and your application has a load\-File() function):



\footnotesize\begin{verbatim} QString tmpFile;
 if( KIO::NetAccess::download( u, tmpFile, window ) )
 {
   loadFile( tmpFile );
   KIO::NetAccess::removeTempFile( tmpFile );
 } else {
   KMessageBox::error(this, KIO::NetAccess::lastErrorString() );
 }
\end{verbatim}
\normalsize


Of course, your user interface will still process exposure/repaint events during the download.

If the download fails, {\bf last\-Error()}{\rm (p.\,\pageref{classKIO_1_1NetAccess_e29})} and {\bf last\-Error\-String()}{\rm (p.\,\pageref{classKIO_1_1NetAccess_e28})} will be set.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]URL Reference to the file to download. \item[{\em target}]String containing the final local location of the file. If you insert an empty string, it will return a location in a temporary spot. {\bf Note:} you are responsible for the removal of this file when you are finished reading it using remove\-Temp\-File. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false for failure. Use {\bf last\-Error\-String()}{\rm (p.\,\pageref{classKIO_1_1NetAccess_e28})} to get the reason it failed.\end{Desc}
\begin{Desc}
\item[See also:]{\bf last\-Error\-String()}{\rm (p.\,\pageref{classKIO_1_1NetAccess_e28})} \end{Desc}


Definition at line 57 of file netaccess.cpp.

References QString::arg(), KIO::Net\-Access$<$ T, K $>$::filecopy\-Internal(), KTemp\-File::name(), and KURL::set\-Path().

Referenced by KIO::Net\-Access$<$ T, K $>$::download().\index{KIO::NetAccess@{KIO::Net\-Access}!download@{download}}
\index{download@{download}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::download (const {\bf KURL} \& {\em src}, {\bf QString} \& {\em target})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e1}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 52 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::download().\index{KIO::NetAccess@{KIO::Net\-Access}!removeTempFile@{removeTempFile}}
\index{removeTempFile@{removeTempFile}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ void Net\-Access::remove\-Temp\-File (const {\bf QString} \& {\em name})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e2}


Removes the specified file if and only if it was created by KIO::Net\-Access as a temporary file for a former download. 

Note: This means that if you created your temporary with {\bf KTemp\-File}, use {\bf KTemp\-File::unlink()} or {\bf KTemp\-File::set\-Auto\-Delete()} to have it removed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]Path to temporary file to remove. May not be empty. \end{description}
\end{Desc}


Definition at line 254 of file netaccess.cpp.\index{KIO::NetAccess@{KIO::Net\-Access}!upload@{upload}}
\index{upload@{upload}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::upload (const {\bf QString} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e3}


Uploads file {\tt src} to URL {\tt target}. 

Both must be specified, unlike download. Note that this is assumed to be used for saving a file over the network, so overwriting is set to true. This is not the case with copy.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]URL Referencing the file to upload. \item[{\em target}]URL containing the final location of the file. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false for failure \end{Desc}


Definition at line 94 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::filecopy\-Internal(), and KURL::set\-Path().

Referenced by KIO::paste\-Data(), and KIO::Net\-Access$<$ T, K $>$::upload().\index{KIO::NetAccess@{KIO::Net\-Access}!upload@{upload}}
\index{upload@{upload}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::upload (const {\bf QString} \& {\em src}, const {\bf KURL} \& {\em target})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e4}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 89 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::upload().\index{KIO::NetAccess@{KIO::Net\-Access}!copy@{copy}}
\index{copy@{copy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::copy (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e5}


Alternative to upload for copying over the network. 

Overwrite is false, so this will fail if {\tt target} exists.

This one takes two URLs and is a direct equivalent of {\bf KIO::file\_\-copy}{\rm (p.\,\pageref{namespaceKIO_a224})} (not {\bf KIO::copy}{\rm (p.\,\pageref{namespaceKIO_a229})}!). It will be renamed file\_\-copy in KDE4, so better use file\_\-copy.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]URL Referencing the file to upload. \item[{\em target}]URL containing the final location of the file. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false for failure \end{Desc}


Definition at line 117 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::file\_\-copy().\index{KIO::NetAccess@{KIO::Net\-Access}!copy@{copy}}
\index{copy@{copy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::copy (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e6}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 112 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::file\_\-copy().\index{KIO::NetAccess@{KIO::Net\-Access}!file_copy@{file\_\-copy}}
\index{file_copy@{file\_\-copy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::file\_\-copy (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em dest}, int {\em permissions} = {\tt -1}, bool {\em overwrite} = {\tt false}, bool {\em resume} = {\tt false}, {\bf QWidget} $\ast$ {\em window} = {\tt 0L})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e7}


Full-fledged equivalent of {\bf KIO::file\_\-copy}{\rm (p.\,\pageref{namespaceKIO_a224})}. 



Definition at line 122 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::filecopy\-Internal().

Referenced by KIO::Net\-Access$<$ T, K $>$::copy().\index{KIO::NetAccess@{KIO::Net\-Access}!file_move@{file\_\-move}}
\index{file_move@{file\_\-move}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::file\_\-move (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target}, int {\em permissions} = {\tt -1}, bool {\em overwrite} = {\tt false}, bool {\em resume} = {\tt false}, {\bf QWidget} $\ast$ {\em window} = {\tt 0L})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e8}


Full-fledged equivalent of {\bf KIO::file\_\-move}{\rm (p.\,\pageref{namespaceKIO_a225})}. 

Moves or renames $\ast$one file$\ast$. \begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 131 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::filecopy\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!dircopy@{dircopy}}
\index{dircopy@{dircopy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::dircopy (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e9}


Alternative method for copying over the network. 

Overwrite is false, so this will fail if {\tt target} exists.

This one takes two URLs and is a direct equivalent of {\bf KIO::copy}{\rm (p.\,\pageref{namespaceKIO_a229})}!. This means that it can copy files and directories alike (it should have been named {\bf copy()}{\rm (p.\,\pageref{classKIO_1_1NetAccess_e5})}).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em src}]URL Referencing the file to upload. \item[{\em target}]URL containing the final location of the file. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false for failure \end{Desc}


Definition at line 144 of file netaccess.cpp.

References QValue\-List::append().

Referenced by KIO::Net\-Access$<$ T, K $>$::dircopy().\index{KIO::NetAccess@{KIO::Net\-Access}!dircopy@{dircopy}}
\index{dircopy@{dircopy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::dircopy (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e10}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 139 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::dircopy().\index{KIO::NetAccess@{KIO::Net\-Access}!dircopy@{dircopy}}
\index{dircopy@{dircopy}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::dircopy (const {\bf KURL::List} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window} = {\tt 0L})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e11}


Overloaded method, which takes a list of source URLs. 



Definition at line 151 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::dircopy\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!move@{move}}
\index{move@{move}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::move (const {\bf KURL} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window} = {\tt 0L})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e12}


Full-fledged equivalent of {\bf KIO::move}{\rm (p.\,\pageref{namespaceKIO_a232})}. 

Moves or renames one file or directory. \begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 157 of file netaccess.cpp.

References QValue\-List::append().\index{KIO::NetAccess@{KIO::Net\-Access}!move@{move}}
\index{move@{move}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::move (const {\bf KURL::List} \& {\em src}, const {\bf KURL} \& {\em target}, {\bf QWidget} $\ast$ {\em window} = {\tt 0L})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e13}


Full-fledged equivalent of {\bf KIO::move}{\rm (p.\,\pageref{namespaceKIO_a232})}. 

Moves or renames a list of files or directories. \begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 164 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::dircopy\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!exists@{exists}}
\index{exists@{exists}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::exists (const {\bf KURL} \& {\em url}, bool {\em source}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e14}


Tests whether a URL exists. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the URL we are testing \item[{\em source}]if true, we want to read from that URL. If false, we want to write to it. IMPORTANT: see documentation for {\bf KIO::stat}{\rm (p.\,\pageref{namespaceKIO_a215})} for more details about this. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the URL exists and we can do the operation specified by {\tt source}, false otherwise \end{Desc}


Definition at line 185 of file netaccess.cpp.

References QFile::exists(), and KIO::Net\-Access$<$ T, K $>$::stat\-Internal().

Referenced by KIO::Net\-Access$<$ T, K $>$::exists(), and KDir\-Operator::mkdir().\index{KIO::NetAccess@{KIO::Net\-Access}!exists@{exists}}
\index{exists@{exists}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::exists (const {\bf KURL} \& {\em url}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e15}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 175 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::exists().\index{KIO::NetAccess@{KIO::Net\-Access}!exists@{exists}}
\index{exists@{exists}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::exists (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e16}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 170 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::exists().\index{KIO::NetAccess@{KIO::Net\-Access}!exists@{exists}}
\index{exists@{exists}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::exists (const {\bf KURL} \& {\em url}, bool {\em source})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e17}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 180 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::exists().\index{KIO::NetAccess@{KIO::Net\-Access}!stat@{stat}}
\index{stat@{stat}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::stat (const {\bf KURL} \& {\em url}, {\bf KIO::UDSEntry} \& {\em entry}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e18}


Tests whether a URL exists and return information on it. 

This is a convenience function for {\bf KIO::stat}{\rm (p.\,\pageref{namespaceKIO_a215})} (it saves creating a slot and testing for the job result).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The URL we are testing. \item[{\em entry}]The result of the stat. Iterate over the list of atoms to get hold of name, type, size, etc., or use {\bf KFile\-Item}{\rm (p.\,\pageref{classKFileItem})}. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false for failure \end{Desc}


Definition at line 198 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::m\_\-entry, and KIO::Net\-Access$<$ T, K $>$::stat\-Internal().

Referenced by KProperties\-Dialog::KProperties\-Dialog(), and KIO::Net\-Access$<$ T, K $>$::stat().\index{KIO::NetAccess@{KIO::Net\-Access}!stat@{stat}}
\index{stat@{stat}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::stat (const {\bf KURL} \& {\em url}, {\bf KIO::UDSEntry} \& {\em entry})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e19}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. \end{Desc}


Definition at line 193 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::stat().\index{KIO::NetAccess@{KIO::Net\-Access}!del@{del}}
\index{del@{del}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::del (const {\bf KURL} \& {\em url}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e20}


Deletes a file or a directory in a synchronous way. 

This is a convenience function for {\bf KIO::del}{\rm (p.\,\pageref{namespaceKIO_a240})} (it saves creating a slot and testing for the job result).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The file or directory to delete. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false on failure. \end{Desc}


Definition at line 212 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::del\-Internal().

Referenced by KIO::Net\-Access$<$ T, K $>$::del().\index{KIO::NetAccess@{KIO::Net\-Access}!del@{del}}
\index{del@{del}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::del (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e21}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. \end{Desc}


Definition at line 207 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::del().\index{KIO::NetAccess@{KIO::Net\-Access}!mkdir@{mkdir}}
\index{mkdir@{mkdir}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::mkdir (const {\bf KURL} \& {\em url}, {\bf QWidget} $\ast$ {\em window}, int {\em permissions} = {\tt -1})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e22}


Creates a directory in a synchronous way. 

This is a convenience function for {\tt {\bf KIO::mkdir}{\rm (p.\,\pageref{namespaceKIO_a206})}} (it saves creating a slot and testing for the job result).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The directory to create. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false on failure. \end{Desc}


Definition at line 223 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::mkdir\-Internal().

Referenced by KIO::Net\-Access$<$ T, K $>$::mkdir(), and KDir\-Operator::mkdir().\index{KIO::NetAccess@{KIO::Net\-Access}!mkdir@{mkdir}}
\index{mkdir@{mkdir}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::mkdir (const {\bf KURL} \& {\em url}, int {\em permissions} = {\tt -1})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e23}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. \end{Desc}


Definition at line 218 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::mkdir().\index{KIO::NetAccess@{KIO::Net\-Access}!fish_execute@{fish\_\-execute}}
\index{fish_execute@{fish\_\-execute}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ {\bf QString} Net\-Access::fish\_\-execute (const {\bf KURL} \& {\em url}, const {\bf QString} {\em command}, {\bf QWidget} $\ast$ {\em window})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e24}


Executes a remote process via the fish ioslave in a synchronous way. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The remote machine where the command should be executed. e.g. fish://someuser@somehost:sshport/ some special cases exist. fish://someuser@localhost/ will use su instead of ssh to connect and execute the command. fish://someuser@localhost:port/ will use ssh to connect and execute the command. \item[{\em command}]The command to be executed. \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The resulting output of the {\tt command} that is executed. \end{Desc}


Definition at line 229 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::fish\_\-execute\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!synchronousRun@{synchronousRun}}
\index{synchronousRun@{synchronousRun}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ bool Net\-Access::synchronous\-Run ({\bf Job} $\ast$ {\em job}, {\bf QWidget} $\ast$ {\em window}, {\bf QByte\-Array} $\ast$ {\em data} = {\tt 0}, {\bf KURL} $\ast$ {\em final\-URL} = {\tt 0}, {\bf QMap}$<$ {\bf QString}, {\bf QString} $>$ $\ast$ {\em meta\-Data} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e25}


This function executes a job in a synchronous way. 

If a job fetches some data, pass a {\bf QByte\-Array} pointer as data parameter to this function and after the function returns it will contain all the data fetched by this job.

{\tt  {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} $\ast$job = KIO::get( url, false, false ); {\bf QMap$<$QString, QString$>$} meta\-Data; meta\-Data.insert( \char`\"{}Propagate\-Http\-Header\char`\"{}, \char`\"{}true\char`\"{} ); if ( Net\-Access::synchronous\-Run( job, 0, \&data, \&url, \&meta\-Data ) ) \{ {\bf QString} response\-Headers = meta\-Data[ \char`\"{}HTTP-Headers\char`\"{} ]; {\bf kd\-Debug()}$<$$<$\char`\"{}Response header = \char`\"{}$<$$<$ response\-Headers $<$$<$ endl; \} }

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job}]job which the function will run. Note that after this function finishes running, job is deleted and you can't access it anymore! \item[{\em window}]main window associated with this job. This is used to automatically cache and discard authentication information as needed. If NULL, authentication information will be cached only for a short duration after which the user will again be prompted for passwords as needed. \item[{\em data}]if passed and relevant to this job then it will contain the data that was fetched by the job \item[{\em final\-URL}]if passed will contain the final url of this job (it might differ from the one it was created with if there was a redirection) \item[{\em meta\-Data}]you can pass a pointer to the map with meta data you wish to set on the job. After the job finishes this map will hold all the meta data from the job.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false on failure.\end{Desc}
\begin{Desc}
\item[Since:]3.4 \end{Desc}


Definition at line 235 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::synchronous\-Run\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!mimetype@{mimetype}}
\index{mimetype@{mimetype}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ {\bf QString} Net\-Access::mimetype (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [static]}}\label{classKIO_1_1NetAccess_e27}


\begin{Desc}
\item[{\bf Deprecated}]. Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. \end{Desc}


Definition at line 242 of file netaccess.cpp.

References KIO::Net\-Access$<$ T, K $>$::mimetype\-Internal().\index{KIO::NetAccess@{KIO::Net\-Access}!lastErrorString@{lastErrorString}}
\index{lastErrorString@{lastErrorString}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ static {\bf QString} {\bf KIO::Net\-Access}$<$ T, K $>$::last\-Error\-String ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKIO_1_1NetAccess_e28}


Returns the error string for the last job, in case it failed. 

Note that this is already translated. \begin{Desc}
\item[Returns:]the last error string, or QString::null \end{Desc}


Definition at line 445 of file netaccess.h.\index{KIO::NetAccess@{KIO::Net\-Access}!lastError@{lastError}}
\index{lastError@{lastError}!KIO::NetAccess@{KIO::Net\-Access}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T, typename K$>$ static int {\bf KIO::Net\-Access}$<$ T, K $>$::last\-Error ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKIO_1_1NetAccess_e29}


Returns the error code for the last job, in case it failed. 

\begin{Desc}
\item[Returns:]the last error code \end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}


Definition at line 452 of file netaccess.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
netaccess.h\item 
netaccess.cpp\end{CompactItemize}
