|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.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.
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.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
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 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. |
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 com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
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 |
---|
public QUrlInfo()
isValid()
.
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)
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.
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)
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(QUrlInfo ui)
Method Detail |
---|
public final java.lang.String group()
setGroup()
, and isValid()
.
public final boolean isDir()
isValid()
.
public final boolean isExecutable()
isValid()
.
public final boolean isFile()
isValid()
.
public final boolean isReadable()
isValid()
.
public final boolean isSymLink()
isValid()
.
public final boolean isValid()
You should always check if the URL info is valid before relying on the values.
public final boolean isWritable()
isValid()
.
public final QDateTime lastModified()
setLastModified()
, and isValid()
.
public final QDateTime lastRead()
setLastRead()
, and isValid()
.
public final java.lang.String name()
setName()
, and isValid()
.
public final java.lang.String owner()
setOwner()
, and isValid()
.
public final int permissions()
setPermissions()
, and isValid()
.
public final void setLastRead(QDateTime dt)
If you call this function for an invalid URL info, this function turns it into a valid one.
lastRead()
, and isValid()
.
public final long size()
setSize()
, and isValid()
.
public void setDir(boolean b)
If you call this function for an invalid URL info, this function turns it into a valid one.
isDir()
, and isValid()
.
public void setFile(boolean b)
If you call this function for an invalid URL info, this function turns it into a valid one.
isFile()
, and isValid()
.
public void setGroup(java.lang.String s)
If you call this function for an invalid URL info, this function turns it into a valid one.
group()
, and isValid()
.
public void setLastModified(QDateTime dt)
If you call this function for an invalid URL info, this function turns it into a valid one.
lastModified()
, and isValid()
.
public void setName(java.lang.String name)
If you call this function for an invalid URL info, this function turns it into a valid one.
name()
, and isValid()
.
public void setOwner(java.lang.String s)
If you call this function for an invalid URL info, this function turns it into a valid one.
owner()
, and isValid()
.
public void setPermissions(int p)
If you call this function for an invalid URL info, this function turns it into a valid one.
permissions()
, and isValid()
.
public void setReadable(boolean b)
If you call this function for an invalid URL info, this function turns it into a valid one.
isReadable()
, and isValid()
.
public void setSize(long size)
If you call this function for an invalid URL info, this function turns it into a valid one.
size()
, and isValid()
.
public void setSymLink(boolean b)
If you call this function for an invalid URL info, this function turns it into a valid one.
isSymLink()
, and isValid()
.
public void setWritable(boolean b)
If you call this function for an invalid URL info, this function turns it into a valid one.
isWritable()
, and isValid()
.
public static boolean equal(QUrlInfo i1, QUrlInfo i2, int sortBy)
QDir::Name
, QDir::Time
or QDir::Size
.
public static boolean greaterThan(QUrlInfo i1, QUrlInfo i2, int sortBy)
QDir::Name
, QDir::Time
or QDir::Size
.
public static boolean lessThan(QUrlInfo i1, QUrlInfo i2, int sortBy)
QDir::Name
, QDir::Time
or QDir::Size
.
public QUrlInfo clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |