Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.network
Class QUrlInfo

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.network.QUrlInfo

All Implemented Interfaces:
  QtJambiInterface, java.lang.Cloneable

    public class QUrlInfo

extends QtJambiObject
implements java.lang.Cloneable

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`, and FTP 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.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

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
`QUrlInfo` | `clone()` This method is reimplemented for internal reasons
`static boolean` | `equal(QUrlInfo i1, QUrlInfo i2, int sortBy)` Returns true if `i1` equals to `i2`; otherwise returns false.
`static QUrlInfo` | `fromNativePointer(QNativePointer nativePointer)` This method 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` | `setLastRead(QDateTime dt)` Specifies that the object the URL refers to was last read 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, equals, 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
`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()

  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`.

### 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(QUrlInfo ui)

  Copy constructor, copies `ui` to this URL info object.

Method Detail

### group

    public final java.lang.String group()

  Returns the group of the URL.

See also:
  `setGroup()`, and `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()`, and `isValid()`.

### lastRead

    public final QDateTime lastRead()

  Returns the date when the URL was last read.

See also:
  `setLastRead()`, and `isValid()`.

### name

    public final java.lang.String name()

  Returns the file name of the URL.

See also:
  `setName()`, and `isValid()`.

### owner

    public final java.lang.String owner()

  Returns the owner of the URL.

See also:
  `setOwner()`, and `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()`, and `isValid()`.

### setLastRead

    public final void setLastRead(QDateTime dt)

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

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

See also:
  `lastRead()`, and `isValid()`.

### size

    public final long size()

  Returns the size of the URL.

See also:
  `setSize()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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()`, and `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 method returns the QUrlInfo instance pointed to by `nativePointer`.

### nativePointerArray

    public static QNativePointer nativePointerArray(QUrlInfo[] array)

  This function returns a QNativePointer that is pointing to the specified QUrlInfo array.

### clone

    public QUrlInfo clone()

  This method is reimplemented for internal reasons

  Overrides:
    `clone` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD