Qt Jambi Home

com.trolltech.qt.network
Class QUrlInfo

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.network.QUrlInfo
All Implemented Interfaces:
QtJambiInterface

public class QUrlInfo
extends QtJambiObject

The QUrlInfo class stores information about URLs.

The information about a URL that can be retrieved includes name, permissions, owner, group, size, lastModified, lastRead, isDir, isFile, isSymLink, isWritable, isReadable and isExecutable.

You can create your own QUrlInfo objects passing in all the relevant information in the constructor, and you can modify a QUrlInfo; for each getter mentioned above there is an equivalent setter. Note that setting values does not affect the underlying resource that the QUrlInfo provides information about; for example if you call setWritable(true) on a read-only resource the only thing changed is the QUrlInfo object, not the resource.

See Also:
QUrl, Example

Nested Class Summary
static class QUrlInfo.PermissionSpec
          This enum is used by the permissions function to report the permissions of a file.
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QUrlInfo()
          Constructs an invalid QUrlInfo object with default values.
QUrlInfo(QUrlInfo ui)
          Copy constructor, copies ui to this URL info object.
QUrlInfo(QUrl url, int permissions, java.lang.String owner, java.lang.String group, long size, QDateTime lastModified, QDateTime lastRead, boolean isDir, boolean isFile, boolean isSymLink, boolean isWritable, boolean isReadable, boolean isExecutable)
          Constructs a QUrlInfo object by specifying all the URL's information.
QUrlInfo(java.lang.String name, int permissions, java.lang.String owner, java.lang.String group, long size, QDateTime lastModified, QDateTime lastRead, boolean isDir, boolean isFile, boolean isSymLink, boolean isWritable, boolean isReadable, boolean isExecutable)
          Constructs a QUrlInfo object by specifying all the URL's information.
 
Method Summary
static boolean equal(QUrlInfo i1, QUrlInfo i2, int sortBy)
          Returns true if i1 equals to i2; otherwise returns false.
 boolean equals(java.lang.Object other)
          
static QUrlInfo fromNativePointer(QNativePointer nativePointer)
          This function returns the QUrlInfo instance pointed to by nativePointer
static boolean greaterThan(QUrlInfo i1, QUrlInfo i2, int sortBy)
          Returns true if i1 is greater than i2; otherwise returns false.
 java.lang.String group()
          Returns the group of the URL.
 boolean isDir()
          Returns true if the URL is a directory; otherwise returns false.
 boolean isExecutable()
          Returns true if the URL is executable; otherwise returns false.
 boolean isFile()
          Returns true if the URL is a file; otherwise returns false.
 boolean isReadable()
          Returns true if the URL is readable; otherwise returns false.
 boolean isSymLink()
          Returns true if the URL is a symbolic link; otherwise returns false.
 boolean isValid()
          Returns true if the URL info is valid; otherwise returns false.
 boolean isWritable()
          Returns true if the URL is writable; otherwise returns false.
 QDateTime lastModified()
          Returns the last modification date of the URL.
 QDateTime lastRead()
          Returns the date when the URL was last read.
static boolean lessThan(QUrlInfo i1, QUrlInfo i2, int sortBy)
          Returns true if i1 is less than i2; otherwise returns false.
 java.lang.String name()
          Returns the file name of the URL.
static QNativePointer nativePointerArray(QUrlInfo[] array)
          This function returns a QNativePointer that is pointing to the specified QUrlInfo array.
 java.lang.String owner()
          Returns the owner of the URL.
 int permissions()
          Returns the permissions of the URL.
 void setDir(boolean b)
          If b is true then the URL is set to be a directory; if b is false then the URL is set not to be a directory (which normally means it is a file).
 void setFile(boolean b)
          If b is true then the URL is set to be a file; if \b is false then the URL is set not to be a file (which normally means it is a directory).
 void setGroup(java.lang.String s)
          Specifies that the owning group of the URL is called s.
 void setLastModified(QDateTime dt)
          Specifies that the object the URL refers to was last modified at dt.
 void setName(java.lang.String name)
          Sets the name of the URL to name.
 void setOwner(java.lang.String s)
          Specifies that the owner of the URL is called s.
 void setPermissions(int p)
          Specifies that the URL has access permissions p.
 void setReadable(boolean b)
          Specifies that the URL is readable if b is true and not readable if b is false.
 void setSize(long size)
          Specifies the size of the URL.
 void setSymLink(boolean b)
          Specifies that the URL refers to a symbolic link if b is true and that it does not if b is false.
 void setWritable(boolean b)
          Specifies that the URL is writable if b is true and not writable if b is false.
 long size()
          Returns the size of the URL.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QUrlInfo

public QUrlInfo(QUrlInfo ui)

Copy constructor, copies ui to this URL info object.


QUrlInfo

public QUrlInfo(QUrl url,
                int permissions,
                java.lang.String owner,
                java.lang.String group,
                long size,
                QDateTime lastModified,
                QDateTime lastRead,
                boolean isDir,
                boolean isFile,
                boolean isSymLink,
                boolean isWritable,
                boolean isReadable,
                boolean isExecutable)

Constructs a QUrlInfo object by specifying all the URL's information.

The information that is passed is the url, file permissions, owner and group and the file's size. Also passed is the lastModified date/time and the lastRead date/time. Flags are also passed, specifically, isDir, isFile, isSymLink, isWritable, isReadable and isExecutable.


QUrlInfo

public QUrlInfo()

Constructs an invalid QUrlInfo object with default values.

See Also:
isValid

QUrlInfo

public QUrlInfo(java.lang.String name,
                int permissions,
                java.lang.String owner,
                java.lang.String group,
                long size,
                QDateTime lastModified,
                QDateTime lastRead,
                boolean isDir,
                boolean isFile,
                boolean isSymLink,
                boolean isWritable,
                boolean isReadable,
                boolean isExecutable)

Constructs a QUrlInfo object by specifying all the URL's information.

The information that is passed is the name, file permissions, owner and group and the file's size. Also passed is the lastModified date/time and the lastRead date/time. Flags are also passed, specifically, isDir, isFile, isSymLink, isWritable, isReadable and isExecutable.

Method Detail

group

public final java.lang.String group()

Returns the group of the URL.

See Also:
setGroup, isValid

isDir

public final boolean isDir()

Returns true if the URL is a directory; otherwise returns false.

See Also:
isValid

isExecutable

public final boolean isExecutable()

Returns true if the URL is executable; otherwise returns false.

See Also:
isValid

isFile

public final boolean isFile()

Returns true if the URL is a file; otherwise returns false.

See Also:
isValid

isReadable

public final boolean isReadable()

Returns true if the URL is readable; otherwise returns false.

See Also:
isValid

isSymLink

public final boolean isSymLink()

Returns true if the URL is a symbolic link; otherwise returns false.

See Also:
isValid

isValid

public final boolean isValid()

Returns true if the URL info is valid; otherwise returns false. Valid means that the QUrlInfo contains real information.

You should always check if the URL info is valid before relying on the values.


isWritable

public final boolean isWritable()

Returns true if the URL is writable; otherwise returns false.

See Also:
isValid

lastModified

public final QDateTime lastModified()

Returns the last modification date of the URL.

See Also:
setLastModified, isValid

lastRead

public final QDateTime lastRead()

Returns the date when the URL was last read.

See Also:
isValid

name

public final java.lang.String name()

Returns the file name of the URL.

See Also:
setName, isValid

owner

public final java.lang.String owner()

Returns the owner of the URL.

See Also:
setOwner, isValid

permissions

public final int permissions()

Returns the permissions of the URL. You can use the PermissionSpec flags to test for certain permissions.

See Also:
setPermissions, isValid

size

public final long size()

Returns the size of the URL.

See Also:
setSize, isValid

setDir

public void setDir(boolean b)

If b is true then the URL is set to be a directory; if b is false then the URL is set not to be a directory (which normally means it is a file). (Note that a URL can refer to both a file and a directory even though most file systems do not support this.)

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
isDir, isValid

setFile

public void setFile(boolean b)

If b is true then the URL is set to be a file; if \b is false then the URL is set not to be a file (which normally means it is a directory). (Note that a URL can refer to both a file and a directory even though most file systems do not support this.)

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
isFile, isValid

setGroup

public void setGroup(java.lang.String s)

Specifies that the owning group of the URL is called s.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
group, isValid

setLastModified

public void setLastModified(QDateTime dt)

Specifies that the object the URL refers to was last modified at dt.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
lastModified, isValid

setName

public void setName(java.lang.String name)

Sets the name of the URL to name. The name is the full text, for example, "http://doc.trolltech.com/qurlinfo.html".

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
name, isValid

setOwner

public void setOwner(java.lang.String s)

Specifies that the owner of the URL is called s.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
owner, isValid

setPermissions

public void setPermissions(int p)

Specifies that the URL has access permissions p.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
permissions, isValid

setReadable

public void setReadable(boolean b)

Specifies that the URL is readable if b is true and not readable if b is false.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
isReadable, isValid

setSize

public void setSize(long size)

Specifies the size of the URL.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
size, isValid

setSymLink

public void setSymLink(boolean b)

Specifies that the URL refers to a symbolic link if b is true and that it does not if b is false.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
isSymLink, isValid

setWritable

public void setWritable(boolean b)

Specifies that the URL is writable if b is true and not writable if b is false.

If you call this function for an invalid URL info, this function turns it into a valid one.

See Also:
isWritable, isValid

equal

public static boolean equal(QUrlInfo i1,
                            QUrlInfo i2,
                            int sortBy)

Returns true if i1 equals to i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.


greaterThan

public static boolean greaterThan(QUrlInfo i1,
                                  QUrlInfo i2,
                                  int sortBy)

Returns true if i1 is greater than i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.


lessThan

public static boolean lessThan(QUrlInfo i1,
                               QUrlInfo i2,
                               int sortBy)

Returns true if i1 is less than i2; otherwise returns false. The objects are compared by the value, which is specified by sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size.


fromNativePointer

public static QUrlInfo fromNativePointer(QNativePointer nativePointer)
This function returns the QUrlInfo instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QUrlInfo[] array)
This function returns a QNativePointer that is pointing to the specified QUrlInfo array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

Qt Jambi Home