|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KTempDir
public class KTempDir
The KTempDir class creates a unique directory for temporary use. This is especially useful if you need to create a directory in a world writable directory like /tmp without being vulnerable to so called symlink attacks. KDE applications, however, shouldn't create files or directories in /tmp in the first place but use the "tmp" resource instead. The standard KTempDir constructor will do that by default. To create a temporary directory that starts with a certain name in the "tmp" resource, one should use: KTempDir(locateLocal("tmp", prefix)); KTempFile does not create any missing directories, but locateLocal() does. See also KStandardDirs
Constructor Summary | |
---|---|
|
KTempDir()
|
protected |
KTempDir(java.lang.Class dummy)
|
|
KTempDir(java.lang.String directoryPrefix)
|
|
KTempDir(java.lang.String directoryPrefix,
int mode)
Creates a temporary directory with the name: \p \ |
Method Summary | |
---|---|
protected boolean |
create(java.lang.String directoryPrefix,
int mode)
Creates a "random" directory with specified mode |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
boolean |
existing()
|
protected void |
finalize()
Deletes the wrapped C++ instance |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
java.lang.String |
name()
Returns the full path and name of the directory, including a trailing '/'. |
org.kde.qt.QDir |
qDir()
Returns the QDir of the temporary directory. |
void |
setAutoDelete(boolean autoDelete)
Turn automatic deletion on or off. |
protected void |
setError(int error)
Sets the errno value |
int |
status()
Returns the status of the directory creation based on errno. |
void |
unlink()
Deletes the directory recursively |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KTempDir(java.lang.Class dummy)
public KTempDir(java.lang.String directoryPrefix, int mode)
directoryPrefixis "$KDEHOME/tmp-$HOST/appname"
directoryPrefix
- the prefix of the file name, or
null for the default valuemode
- the file permissions,
almost always in octal. The first digit selects permissions for
the user who owns the file: read (4), write (2), and execute
(1); the second selects permissions for other users in the
file's group, with the same values; and the fourth for other
users not in the file's group, with the same values.public KTempDir(java.lang.String directoryPrefix)
public KTempDir()
Method Detail |
---|
public void setAutoDelete(boolean autoDelete)
autoDelete
- true to turn automatic deletion onpublic int status()
public java.lang.String name()
public org.kde.qt.QDir qDir()
public void unlink()
public boolean existing()
protected boolean create(java.lang.String directoryPrefix, int mode)
directoryPrefix
- to use when creating temp directory
(the rest is generated randomly)mode
- directory permissions
protected void setError(int error)
error
- the value to set the status to.protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |