|
|
|
@ -12,9 +12,9 @@ import org.kde.qt.TQObject;
|
|
|
|
|
|
|
|
|
|
Net Transparency.
|
|
|
|
|
NetAccess allows you to do simple file operation (load, save,
|
|
|
|
|
copy, delete...) without working with KIO.Job directly.
|
|
|
|
|
Whereas a KIO.Job is asynchronous, meaning that the
|
|
|
|
|
developer has to connect slots for it, KIO.NetAccess provides
|
|
|
|
|
copy, delete...) without working with TDEIO.Job directly.
|
|
|
|
|
Whereas a TDEIO.Job is asynchronous, meaning that the
|
|
|
|
|
developer has to connect slots for it, TDEIO.NetAccess provides
|
|
|
|
|
synchronous downloads and uploads, as well as temporary file
|
|
|
|
|
creation and removal. The functions appear to be blocking,
|
|
|
|
|
but the Qt event loop continues running while the operations
|
|
|
|
@ -48,12 +48,12 @@ public class NetAccess extends TQObject {
|
|
|
|
|
application has a loadFile() function):
|
|
|
|
|
<pre>
|
|
|
|
|
String tmpFile;
|
|
|
|
|
if( KIO.NetAccess.download( u, tmpFile, window ) )
|
|
|
|
|
if( TDEIO.NetAccess.download( u, tmpFile, window ) )
|
|
|
|
|
{
|
|
|
|
|
loadFile( tmpFile );
|
|
|
|
|
KIO.NetAccess.removeTempFile( tmpFile );
|
|
|
|
|
TDEIO.NetAccess.removeTempFile( tmpFile );
|
|
|
|
|
} else {
|
|
|
|
|
KMessageBox.error(this, KIO.NetAccess.lastErrorString() );
|
|
|
|
|
KMessageBox.error(this, TDEIO.NetAccess.lastErrorString() );
|
|
|
|
|
}
|
|
|
|
|
</pre>
|
|
|
|
|
Of course, your user interface will still process exposure/repaint
|
|
|
|
@ -79,13 +79,13 @@ public class NetAccess extends TQObject {
|
|
|
|
|
public static native boolean download(KURL src, StringBuffer target, TQWidget window);
|
|
|
|
|
/**
|
|
|
|
|
Removes the specified file if and only if it was created
|
|
|
|
|
by KIO.NetAccess as a temporary file for a former download.
|
|
|
|
|
by TDEIO.NetAccess as a temporary file for a former download.
|
|
|
|
|
Note: This means that if you created your temporary with KTempFile,
|
|
|
|
|
use KTempFile.unlink() or KTempFile.setAutoDelete() to have
|
|
|
|
|
it removed.
|
|
|
|
|
@param name Path to temporary file to remove. May not be
|
|
|
|
|
empty.
|
|
|
|
|
@short Removes the specified file if and only if it was created by KIO.NetAccess as a temporary file for a former download.
|
|
|
|
|
@short Removes the specified file if and only if it was created by TDEIO.NetAccess as a temporary file for a former download.
|
|
|
|
|
*/
|
|
|
|
|
public static native void removeTempFile(String name);
|
|
|
|
|
/**
|
|
|
|
@ -110,7 +110,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
Alternative to upload for copying over the network.
|
|
|
|
|
Overwrite is false, so this will fail if <code>target</code> exists.
|
|
|
|
|
This one takes two URLs and is a direct equivalent
|
|
|
|
|
of KIO.file_copy (not KIO.copy!).
|
|
|
|
|
of TDEIO.file_copy (not TDEIO.copy!).
|
|
|
|
|
It will be renamed file_copy in KDE4, so better use file_copy.
|
|
|
|
|
@param src URL Referencing the file to upload.
|
|
|
|
|
@param target URL containing the final location of the file.
|
|
|
|
@ -125,8 +125,8 @@ public class NetAccess extends TQObject {
|
|
|
|
|
*/
|
|
|
|
|
public static native boolean copy(KURL src, KURL target, TQWidget window);
|
|
|
|
|
/**
|
|
|
|
|
Full-fledged equivalent of KIO.file_copy
|
|
|
|
|
@short Full-fledged equivalent of KIO.file_copy
|
|
|
|
|
Full-fledged equivalent of TDEIO.file_copy
|
|
|
|
|
@short Full-fledged equivalent of TDEIO.file_copy
|
|
|
|
|
*/
|
|
|
|
|
public static native boolean file_copy(KURL src, KURL dest, int permissions, boolean overwrite, boolean resume, TQWidget window);
|
|
|
|
|
public static native boolean file_copy(KURL src, KURL dest, int permissions, boolean overwrite, boolean resume);
|
|
|
|
@ -134,9 +134,9 @@ public class NetAccess extends TQObject {
|
|
|
|
|
public static native boolean file_copy(KURL src, KURL dest, int permissions);
|
|
|
|
|
public static native boolean file_copy(KURL src, KURL dest);
|
|
|
|
|
/**
|
|
|
|
|
Full-fledged equivalent of KIO.file_move.
|
|
|
|
|
Full-fledged equivalent of TDEIO.file_move.
|
|
|
|
|
Moves or renames one file.
|
|
|
|
|
@short Full-fledged equivalent of KIO.file_move.
|
|
|
|
|
@short Full-fledged equivalent of TDEIO.file_move.
|
|
|
|
|
*/
|
|
|
|
|
public static native boolean file_move(KURL src, KURL target, int permissions, boolean overwrite, boolean resume, TQWidget window);
|
|
|
|
|
public static native boolean file_move(KURL src, KURL target, int permissions, boolean overwrite, boolean resume);
|
|
|
|
@ -147,7 +147,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
Alternative method for copying over the network.
|
|
|
|
|
Overwrite is false, so this will fail if <code>target</code> exists.
|
|
|
|
|
This one takes two URLs and is a direct equivalent
|
|
|
|
|
of KIO.copy!.
|
|
|
|
|
of TDEIO.copy!.
|
|
|
|
|
This means that it can copy files and directories alike
|
|
|
|
|
(it should have been named copy()).
|
|
|
|
|
@param src URL Referencing the file to upload.
|
|
|
|
@ -170,16 +170,16 @@ public class NetAccess extends TQObject {
|
|
|
|
|
public static native boolean dircopy(ArrayList src, KURL target, TQWidget window);
|
|
|
|
|
public static native boolean dircopy(ArrayList src, KURL target);
|
|
|
|
|
/**
|
|
|
|
|
Full-fledged equivalent of KIO.move.
|
|
|
|
|
Full-fledged equivalent of TDEIO.move.
|
|
|
|
|
Moves or renames one file or directory.
|
|
|
|
|
@short Full-fledged equivalent of KIO.move.
|
|
|
|
|
@short Full-fledged equivalent of TDEIO.move.
|
|
|
|
|
*/
|
|
|
|
|
public static native boolean move(KURL src, KURL target, TQWidget window);
|
|
|
|
|
public static native boolean move(KURL src, KURL target);
|
|
|
|
|
/**
|
|
|
|
|
Full-fledged equivalent of KIO.move.
|
|
|
|
|
Full-fledged equivalent of TDEIO.move.
|
|
|
|
|
Moves or renames a list of files or directories.
|
|
|
|
|
@short Full-fledged equivalent of KIO.move.
|
|
|
|
|
@short Full-fledged equivalent of TDEIO.move.
|
|
|
|
|
*/
|
|
|
|
|
public static native boolean move(ArrayList src, KURL target, TQWidget window);
|
|
|
|
|
public static native boolean move(ArrayList src, KURL target);
|
|
|
|
@ -188,7 +188,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
@param url the URL we are testing
|
|
|
|
|
@param source if true, we want to read from that URL.
|
|
|
|
|
If false, we want to write to it.
|
|
|
|
|
IMPORTANT: see documentation for KIO.stat for more details about this.
|
|
|
|
|
IMPORTANT: see documentation for TDEIO.stat for more details about this.
|
|
|
|
|
@param 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
|
|
|
|
@ -202,7 +202,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
public static native boolean exists(KURL url, boolean source, TQWidget window);
|
|
|
|
|
/**
|
|
|
|
|
Tests whether a URL exists and return information on it.
|
|
|
|
|
This is a convenience function for KIO.stat
|
|
|
|
|
This is a convenience function for TDEIO.stat
|
|
|
|
|
(it saves creating a slot and testing for the job result).
|
|
|
|
|
@param url The URL we are testing.
|
|
|
|
|
@param entry The result of the stat. Iterate over the list
|
|
|
|
@ -219,7 +219,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
// bool stat(const KURL& arg1,TDEIO::UDSEntry& arg2,TQWidget* arg3); >>>> NOT CONVERTED
|
|
|
|
|
/**
|
|
|
|
|
Tries to map a local URL for the given URL.
|
|
|
|
|
This is a convenience function for KIO.stat + parsing the
|
|
|
|
|
This is a convenience function for TDEIO.stat + parsing the
|
|
|
|
|
resulting UDSEntry.
|
|
|
|
|
@param url The URL we are testing.
|
|
|
|
|
@param window main window associated with this job. This is used to
|
|
|
|
@ -235,7 +235,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
public static native KURL mostLocalURL(KURL url, TQWidget window);
|
|
|
|
|
/**
|
|
|
|
|
Deletes a file or a directory in a synchronous way.
|
|
|
|
|
This is a convenience function for KIO.del
|
|
|
|
|
This is a convenience function for TDEIO.del
|
|
|
|
|
(it saves creating a slot and testing for the job result).
|
|
|
|
|
@param url The file or directory to delete.
|
|
|
|
|
@param window main window associated with this job. This is used to
|
|
|
|
@ -290,7 +290,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
If a job fetches some data, pass a byte[] pointer as data parameter to this function
|
|
|
|
|
and after the function returns it will contain all the data fetched by this job.
|
|
|
|
|
<code>
|
|
|
|
|
KIO.Job job = KIO.get( url, false, false );
|
|
|
|
|
TDEIO.Job job = TDEIO.get( url, false, false );
|
|
|
|
|
TQMap<String, String> metaData;
|
|
|
|
|
metaData.insert( "PropagateHttpHeader", "true" );
|
|
|
|
|
if ( NetAccess.synchronousRun( job, 0, &data, &url, &metaData ) ) {
|
|
|
|
@ -324,7 +324,7 @@ public class NetAccess extends TQObject {
|
|
|
|
|
This function is not implemented!?
|
|
|
|
|
(only mimetypeInternal)
|
|
|
|
|
Determines the mimetype of a given URL.
|
|
|
|
|
This is a convenience function for KIO.mimetype. You
|
|
|
|
|
This is a convenience function for TDEIO.mimetype. You
|
|
|
|
|
should call this only when really necessary.
|
|
|
|
|
KMimeType.findByURL can determine extension a lot faster, but
|
|
|
|
|
less reliably for remote files. Only when findByURL() returns
|
|
|
|
|