|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.network.QUrlInfo
public class QUrlInfo
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.
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 |
---|
public QUrlInfo(QUrlInfo ui)
Copy constructor, copies ui to this URL info object.
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.
public QUrlInfo()
Constructs an invalid QUrlInfo object with default values.
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 |
---|
public final java.lang.String group()
Returns the group of the URL.
public final boolean isDir()
Returns true if the URL is a directory; otherwise returns false.
public final boolean isExecutable()
Returns true if the URL is executable; otherwise returns false.
public final boolean isFile()
Returns true if the URL is a file; otherwise returns false.
public final boolean isReadable()
Returns true if the URL is readable; otherwise returns false.
public final boolean isSymLink()
Returns true if the URL is a symbolic link; otherwise returns false.
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.
public final boolean isWritable()
Returns true if the URL is writable; otherwise returns false.
public final QDateTime lastModified()
Returns the last modification date of the URL.
public final QDateTime lastRead()
Returns the date when the URL was last read.
public final java.lang.String name()
Returns the file name of the URL.
public final java.lang.String owner()
Returns the owner of the URL.
public final int permissions()
Returns the permissions of the URL. You can use the PermissionSpec flags to test for certain permissions.
public final long size()
Returns the size of the URL.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
public static QUrlInfo fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QUrlInfo[] array)
array
- the array that the returned pointer will point to.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |